Simply the Best
Shareware & Freeware

Business
Graphics
Programming
Utilities
Web utilities
Home and Hobby

Simply the Best
Scripts

DHTML Scripts
JavaScripts
CGI Scripts
PHP Scripts
VBScripts

Simply the Best
Free Fonts

Fonts of the month
Fonts guide
Submit font
Font search

Simply the Best
Web Search

Advanced search
Top keywords
Add URL

Simply the Best
Music

Music artists
Music industry
Submit listing
Music guide

SimplytheBest Info Library
Blogs
Free Fonts
Friends
Free Online Games
Music
Scripts
Software
Free Sounds
and more..

 
DHTML script
 

SimplytheBest
Scripts

ASP scripts
PERL scripts
PHP scripts
JavaScripts & Ajax
Snippets
Online scripts

Ajax, DHTML
& JavaScripts

Animation
Background
Bookmarks
Buttons
Calculators
Cookies
Data handling
E-mail
Enhancements
Forms
Image rotation
Menus
Messages
Miscellaneous
Music
Password protection
Redirection
Scrollers
Tables
Time & date
Windows

Publishers
Add script
Account login
Publisher list



 

Home > Scripts > DHTML scripts & JavaScripts > Animation > Rotating images or text with popup messages

 

Rotating images or text with popup messages

AUTHOR: PEN99
TYPE: Freeware
BROWSERS:
IE 4+, IE 5+, IE 6+, NS 4+

A script that makes images or text rotate with popup text messages. It will provide the user with information about what will happen before they click on a link as well as navigational help.


EXAMPLE

 

 

 

 

 

 

 

 



1)
Insert the following code in the <HEAD> section of the page.

then copy (CTRL-C) & paste (CTRL-V)

2) Insert the following script in the <HEAD>, between <HEAD> and <BODY> or in the <BODY> section of the page.

then copy (CTRL-C) & paste (CTRL-V)

3) Insert the following HTML code anywhere inside the <BODY> section.

then copy (CTRL-C) & paste (CTRL-V)

This is how the script works:

There are 4 sections in the HTML document:
1) the <STYLE> section
2) the script section
3) the rotating images/text section
4) the popup text section

In the <STYLE> section you define the font-family, font size, font color and position of the popup text (style class .text). If you decide to use rotating text instead of the images you define the font variables for the text in the style class .circle:

<style>
<!--
.circle { font-family: Verdana, Helvetica; font-size: 12px; color: #000000
position: absolute; visibility: hidden; z-index: 2 }

.text { text-align: left; font-family: Verdana, Helvetica; font-size: 12px; color: #000000
position: absolute; top: 365px; left: 255px; width: 225px; visibility: hidden; z-index: 0 }

In the script section you define the size of the radius of the circle, the position and the speed of the rotating images/text:

// Variables for rotating images/text //
var objects;
var pos;
// radius size
var r = 150;
// horizontal position
var xoff = 320;
// vertical position
var yoff = 350;
var pi = Math.PI; 
// the higher the number the slower the speed of rotation
var inc = pi / 180;

In the rotating images/text section you assign the images/text and the hyperlinks:

<div id="circle1" class="circle">
<a href="http://simplythebest.net/software/" onmouseover="showObject(text1)" onmouseout="hideObject(text1)"><img src="images/shareware.gif" border="0" width="111" height="29"></a><br>
</div>
<div id="circle2" class="circle">
<a href="http://simplythebest.net/scripts/" onmouseover="showObject(text2)" onmouseout="hideObject(text2)"><img src="images/dhtml_scripts.gif" border="0" width="111" height="29"></a><br>
</div>
and so forth...

In the popup text section you define the text that pops up with each rotating image/text:

<div id="text1" class="text">
<p align="center"><b>Simply the Best<br>
Shareware & Freeware</b><br>
Business<br>
Graphics<br>
Programming<br>
Utilities<br>
Web utilities<br>
Home and Hobby</p>
</div>
<div id="text2" class="text">
<p align="center"><b>Simply the Best<br>
Scripts</b><br>
DHTML Scripts<br>
Javascripts</p>
</div>
and so forth...


[BACK] [TOP]

 


Copyright © 1997-2009 SimplytheBest Inc. Terms of Use and Legal Disclaimer.
All copyrights are acknowledged. All rights reserved.