•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 456,234 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,762 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1563 | Replies: 8
![]() |
Hello, I want to add the following 2 functions to the code below. I have no Idea At all, Please Help. I want the images to rotate as they do now, but Id like to add random transitions to each image change.
The Code
function applyeffect(){
if (document.all && photoslider.filters){
photoslider.filters.revealTrans.Transition=Math.fl oor(Math.random()*23)
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}function playeffect(){
if (document.all && photoslider.filters)
photoslider.filters.revealTrans.play()
}The Code
<style>
body{
background-attachment:fixed;
background-repeat: no-repeat;
}
</style>
<script language="JavaScript1.2">
//Background Image Slideshow- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com
//Specify background images to slide
var bgslides=new Array()
bgslides[0]="http://i14.photobucket.com/albums/a345/Instar/greenbgfade17oi.jpg"
bgslides[1]="http://i14.photobucket.com/albums/a345/Instar/rsntort1024-1.jpg"
bgslides[2]="http://i14.photobucket.com/albums/a345/Instar/WesternDiamondBackRattlesnake-1.jpg"
bgslides[3]="http://i14.photobucket.com/albums/a345/Instar/reptile_003-1.jpg"
bgslides[4]="http://i14.photobucket.com/albums/a345/Instar/reptileCopperheadSnake-1.jpg"
bgslides[5]="http://i14.photobucket.com/albums/a345/Instar/turtlesbg-1.jpg"
bgslides[6]="http://i14.photobucket.com/albums/a345/Instar/reptile_001-1.jpg"
bgslides[7]="http://i14.photobucket.com/albums/a345/Instar/Picture163-1.jpg"
bgslides[8]="http://i14.photobucket.com/albums/a345/Instar/NzCommonGreenGeckoCloseup-1.jpg"
bgslides[9]="http://i14.photobucket.com/albums/a345/Instar/crocodile_3-1.jpg"
bgslides[10]="http://i14.photobucket.com/albums/a345/Instar/FijianSkinkEatingEarwig-1.jpg"
bgslides[11]="http://i14.photobucket.com/albums/a345/Instar/HornedLizard-1.jpg"
bgslides[12]="http://i14.photobucket.com/albums/a345/Instar/1113330679_1280-1.jpg"
bgslides[13]="http://i14.photobucket.com/albums/a345/Instar/Croc-1.jpg"
bgslides[14]="http://i14.photobucket.com/albums/a345/Instar/Chameleon_Wallpaper_by_phreeza-1.jpg"
bgslides[15]="http://i14.photobucket.com/albums/a345/Instar/1113330784_1280-1.jpg"
//Specify interval between slide (in miliseconds)
var speed=3000
//preload images
var processed=new Array()
for (i=0;i<bgslides.length;i++){
processed[i]=new Image()
processed[i].src=bgslides[i]
}
var inc=-1
function slideback(){
if (inc<bgslides.length-1)
inc++
else
inc=0
document.body.background=processed[inc].src
}
if (document.all||document.getElementById)
window.onload=new Function('setInterval("slideback()",speed)')
</script> Always carry a flagon of whiskey in case of snakebite and furthermore always carry a small snake.
W. C. Fields
W. C. Fields
What is 'photoslider.filters'? Where is it defined? You just can't paste any random code here and expect someone to figure out what is going on.
Last edited by ~s.o.s~ : Nov 15th, 2007 at 1:30 pm.
I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
I dosent matter what photosliders is its just a function example. You've heard of MSIE transistions yes? I want to make each image change with a random transition. Whats difficult to understand ?
Your never helpful SOS your too arrogant!
Your never helpful SOS your too arrogant!
Always carry a flagon of whiskey in case of snakebite and furthermore always carry a small snake.
W. C. Fields
W. C. Fields
We need to know what these are and what variables and/or parameters they need or affect:
- photoslider.filters - photoslider.filters.revealTrans.Transition - photoslider.filters.revealTrans.stop() - photoslider.filters.revealTrans.apply() - speed - processed - window.onload setInterval is a built-in function. You can't use its name for another purpose.
Last edited by MidiMagic : Nov 19th, 2007 at 8:48 pm.
Daylight-saving time uses more gasoline
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access activation ajax api asp blogger blogging blogs code combo dani daniweb data debugging developer development dreamweaver dropdownlist firefox gdata google gpl home html innovation internet javascript key linux microsoft module msdn net news office openbsd product programming reuse rss serial site software source sql tags vista web wysiwyg xml
- C++ Performance Tips (C++)
- Dual hard drives (Storage)
- (reformatted) How to return Multi-Dimensional Arrays (C++)
- User defined functions (C++)
- Need help with existing code (PHP)
- statement adding extra space (Python)
- Need help writing a program (C++)
- i need code for binary to decimal (it should be written in 'C') (C)
- Adding Totals from Listbox DB (DAO) (Visual Basic 4 / 5 / 6)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Pages Not rendering In Mozilla Help?
- Next Thread: Attempting to render shimmering text



Linear Mode