User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Oct 2005
Posts: 236
Reputation: Inny is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
Inny's Avatar
Inny Inny is offline Offline
Posting Whiz in Training

Adding Functions to existing code (transitions)

  #1  
Nov 12th, 2007
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.

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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2005
Posts: 236
Reputation: Inny is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
Inny's Avatar
Inny Inny is offline Offline
Posting Whiz in Training

Re: Adding Functions to existing code (transitions)

  #2  
Nov 13th, 2007
Bump, Anyone please?
Always carry a flagon of whiskey in case of snakebite and furthermore always carry a small snake.
W. C. Fields
Reply With Quote  
Join Date: Jan 2007
Posts: 2,604
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 119
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Adding Functions to existing code (transitions)

  #3  
Nov 15th, 2007
I'm not sure what you want.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Oct 2005
Posts: 236
Reputation: Inny is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
Inny's Avatar
Inny Inny is offline Offline
Posting Whiz in Training

Re: Adding Functions to existing code (transitions)

  #4  
Nov 15th, 2007
I want each image changing with an MSIE transition (random)
Always carry a flagon of whiskey in case of snakebite and furthermore always carry a small snake.
W. C. Fields
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 7,012
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 25
Solved Threads: 368
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: Adding Functions to existing code (transitions)

  #5  
Nov 15th, 2007
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.
Reply With Quote  
Join Date: Oct 2005
Posts: 236
Reputation: Inny is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
Inny's Avatar
Inny Inny is offline Offline
Posting Whiz in Training

Re: Adding Functions to existing code (transitions)

  #6  
Nov 15th, 2007
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!
Always carry a flagon of whiskey in case of snakebite and furthermore always carry a small snake.
W. C. Fields
Reply With Quote  
Join Date: Jan 2007
Posts: 2,604
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 119
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Adding Functions to existing code (transitions)

  #7  
Nov 15th, 2007
The problems are:

1. We aren't mind readers. We don't know what all of the parameters and variables represent.

2. Your lines are too long. The right ends of many of your statements are cut off by the window edge.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Oct 2005
Posts: 236
Reputation: Inny is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
Inny's Avatar
Inny Inny is offline Offline
Posting Whiz in Training

Re: Adding Functions to existing code (transitions)

  #8  
Nov 17th, 2007
In the slideshow script above? I can see it all.
It works fine, The script is clear enough.
Please stop jerking me around, can it be done or not?
Always carry a flagon of whiskey in case of snakebite and furthermore always carry a small snake.
W. C. Fields
Reply With Quote  
Join Date: Jan 2007
Posts: 2,604
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 119
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Adding Functions to existing code (transitions)

  #9  
Nov 19th, 2007
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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 5:07 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC