|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all
if anyone could point out where I'm going wrong here I would be most grateful. basically when the layer repositions itself, the clip area disappears (only in netscape, ie is fine). I've been looking for two days and its starting to make me go a bit mad code below +++++++++++++++++++++++++++++++++++++++++++ <HTML> <HEAD> <? function lhmenu_block($image,$url,$text) { return " <tr> <td><img src="images/trans.gif" width=5 height=71 border=0 alt=""></td> <td height="71" width="106" bgcolor="#ffffff" align="center" valign="middle"> <table border="0" cellpadding="0" cellspacing="1"> <tr> <td><a href="$url"><img src="images/content/Sidebar/$image" width=104 height=69 border=0 alt=""></a></td> </tr> </table> </td> <td><img src="images/trans.gif" width=5 height=71 border=0 alt=""></td> </tr> <tr> <td colspan="3" bgcolor="#00004c" height="27" align="center" valign="middle"><i> <font color="#FFC600" size="1" face="arial">$text</font></i></td> </tr> "; } function all_menu_block($offset) { echo "<table cellpadding=0 cellspacing=0><tr>"; for ($imgno=0+$offset; $imgno<5+$offset; $imgno++) { echo "<td><table cellpadding=0 cellspacing=0>n"; echo lhmenu_block(getimgurl($imgno),geturl($imgno),getdesc($imgno)); echo "n</table></td>n"; } echo "<td><table cellpadding=0 cellspacing=0>n"; echo lhmenu_block(getimgurl($offset+0),geturl($offset+0),getdesc($offset+0)); echo "n</table></td>n"; echo "</tr></table>"; } function getimgurl($no) { if ($no>4) $no -= 5; return "thepeople.gif"; } function geturl($no) { if ($no>4) $no -= 5; return "http://www.somewhere.com/"; } function getdesc($no) { if ($no>4) $no -= 5; return "foo $no"; } ?> <div id="warthog0" style="position:absolute; visibility: hidden; left:58px; top:238px; clip:rect(0px 112px 120px 0px); background-color:white; z-index:99; border: 1px solid white;"> <? all_menu_block(0) ?> </div> <div id="warthog1" style="position:absolute; visibility: hidden; left:58px; top:338px; clip:rect(0px 112px 120px 0px); background-color:white; z-index:98; border: 1px solid white;"> <? all_menu_block(1) ?> </div> <div id="warthog2" style="position:absolute; visibility: hidden; left:58px; top:438px; clip:rect(0px 112px 120px 0px); background-color:white; z-index:97; border: 1px solid white;"> <? all_menu_block(2) ?> </div> <script language="JavaScript" src="js/dynlayer.js"></script> <script language="JavaScript"> <!-- <? # some constants ?> delay=10; delaybetween = 1500; <? # hack for netscape as it renders the cells wider. Look don't ask okay! ?> dist=4; w = 116; if (document.layers) { w = 126; dist=6; } <? # this function is called every time the # layer is slid left. All it does it at # the same time slide the clipping area on # that image right ?> function adjustclip() { dyn.clipBy(0,dist,0,dist); } <? # After each slide has ended we must # check if we've reached the end image (which is # identical to the first) and quickly swap # to the first again if this is true ?> function checkFlip() { <? # do we need to 'flip' ?> if (dyn.clipValues('l')>=w*5) { dyn.moveBy(w*5,0); dyn.clipBy(0,-w*5,0,-w*5); <? # dyn.clipTo(0,112,0,120); ?> } <? # move onto the next layer ?> dync++; if (dync>maxdyn) dync=0; dyn = dyns[dync]; <? # reset the timer to go again ?> setTimeout(slide,delaybetween); } <? # slide the menu across one square ?> function slide() { dyn.slideInit(); dyn.onSlide = adjustclip; dyn.onSlideEnd = checkFlip; dyn.slideBy(-w,0,dist,delay); } <? # setup the slide # okay? ?> function slidesetup() { dyns = new Object(); dyns[0] = new DynLayer("warthog0"); dyns[1] = new DynLayer("warthog1"); dyns[2] = new DynLayer("warthog2"); dyns[0].show(); dyns[1].show(); dyns[2].show(); dync = 0; maxdyn=2; dyn = dyns[dync]; setTimeout(slide,delaybetween); } <? # wait for a short whie for the layers # to be formed before setting everything off ?> setTimeout(slidesetup,1000); // --> </script> <body bgcolor="#ffccff"> +++++++++++++++++++++++++++++ tia tim |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > scrolling layers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|