PDA

View Full Version : javascripts


alissa
08-06-2004, 01:11 PM
Anybody know javascript + DHTML?
I desperately need help altering a script I'm using on my website.

Thx,
alissa

Steven Edwards
08-06-2004, 01:14 PM
What do you need, Alissa?

-Steven
...child, when life don't seem worth livin', come to jesus and let him hold you in his arms

alissa
08-06-2004, 03:03 PM
Hi Steven,

I've got this DHTML slideshow that continuously loops. On mouseover, I can link each image with a url. What I want to do is pause the slideshow on mouseover.
Please look at http://gravityfreegraphix.com/2djava.htm

Let me know if you are able to view the source code from there. Thanks so much for any help.

peace

Steven Edwards
08-06-2004, 03:41 PM
Just paste this in the body portion and you should be good:

<body bgcolor="#999999" text="#000000">
<font color="#FFFFFF"></font> <a href="javascript:gotoshow()"> <img src="2droom.jpg" name="slide" border=0 onmouseover="javascript:setpause()" onmouseout="javascript:unpause()" style="filter:blendTrans(duration=3)" width=600 height=450 vspace="50" hspace="150">
<script language="JavaScript1.1">
<!--

var whichlink=0
var whichimage=0
var pause = 0
var blenddelay=(ie)? document.images.slide.filters[0].duration*1000 : 0
function slideit(){
if (!document.images) return
if (ie) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie) document.images.slide.filters[0].play()
whichlink=whichimage
if (pause == 0) whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+blenddelay)
}
slideit()

function setpause {
pause = 1
}

function unpause {
pause = 0
}

//-->
</script>
</a>
<p align="center"><font face="arial" size="-2">This free script provided by<br>

<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>
</body> That's some great artwork. http://sci.rutgers.edu/forum/images/smilies/smile.gif

-Steven
...child, when life don't seem worth livin', come to jesus and let him hold you in his arms

alissa
08-06-2004, 07:08 PM
Steven - Thanks for your help, and I'm glad you like. I'll let you know when I'm done.

peace,
Alissa

alissa
08-07-2004, 01:12 PM
Hi again,

That didn't work. I'm getting the 1st error on line 63 after
function setpause

Thoughts?
Thanks again.

peace,
Alissa

Steven Edwards
08-07-2004, 01:31 PM
Can you give me a link to a copy of the page with the error?

-Steven
...child, when life don't seem worth livin', come to jesus and let him hold you in his arms

alissa
08-09-2004, 04:39 PM
Steven,

Here's that link:
http://gravityfreegraphix.com/2djavaX.htm

peace & thanks

Steven Edwards
08-09-2004, 05:52 PM
Oy, sorry... this will work [already checked]:

<script language=JavaScript1.1>
< !--

var whichlink=0
var whichimage=0
var pause = 0
var blenddelay=(ie)? document.images.slide.filters[0].duration*1000 : 0
function slideit(){
if (!document.images) return
if (ie) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie) document.images.slide.filters[0].play()
whichlink=whichimage
if (pause == 0) whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+blenddelay)
}
slideit()

function setpause() {
pause = 1
whichimage=(whichimage==0)? slideimages.length-1 : whichimage-1;
}

function unpause() {
pause = 0
}

//-->
</SCRIPT> Just replace the script portion with this and you'll be good.

BTW, do you want people to go to certain sites when they click on the images?

-Steven
...child, when life don't seem worth livin', come to jesus and let him hold you in his arms

alissa
08-10-2004, 04:54 PM
Thanks again, Steven. And yes, I would like to send people to other links if it's possible with the mouseover/pause change. Is it?

peace

Steven Edwards
08-10-2004, 05:04 PM
Yes, it is. Where do you want them to be sent to?

-Steven
...child, when life don't seem worth livin', come to jesus and let him hold you in his arms

alissa
08-10-2004, 06:01 PM
I haven't decided yet.
does it affect the script below?

Steven Edwards
08-10-2004, 06:05 PM
Nope, not at all. Just change the URLs up top.

-Steven
...child, when life don't seem worth livin', come to jesus and let him hold you in his arms

alissa
08-10-2004, 06:42 PM
Wow, this is not working. I feel so dumb.
same link http://sci.rutgers.edu/forum/images/smilies/rolleyes.gif

Steven Edwards
08-10-2004, 07:14 PM
Don't feel dumb. I forgot to mention that you need to add the following to your <img tag:

onmouseover="javascript:setpause()" onmouseout="javascript:unpause()" My apologies. http://sci.rutgers.edu/forum/images/smilies/smile.gif

-Steven
...child, when life don't seem worth livin', come to jesus and let him hold you in his arms

alissa
08-11-2004, 01:23 PM
OK, 1 more idiot ? of the decade -
where exactly does this go? Sorry, I'm such a bonehead. Thanks again.

Steven Edwards
08-11-2004, 01:48 PM
You can add the portion below [onmouseover=...] right after the <img tag so that it starts off <img onmouseover="javascript:setpause()" onmouseout="javascript:unpause()"

-Steven
...child, when life don't seem worth livin', come to jesus and let him hold you in his arms

alissa
08-11-2004, 02:45 PM
do you mean < img src =
so it would go between img and src?

also, I'm getting an error at
&lt;script language="JavaScript1.1">
< !-- THIS LINE: ERROR 1005 EXPRESSION EXPECTED

Would you mind reposting the script for me with that last insert? I'm geting soooooo confused.

Thank you for your help.
Peace,
alissa