Jump to content

Help with js horizontal sliding divs


GE2009

Recommended Posts

Hello all, I can't say that I'm new to JS, but then again I may as well be since all I can do is edit small bits of the rudidementary code generated by Dw and the small js functionality it can give your page content. Can I get any help with creatng a simple script that would allow my targeted div to call a function that will smoothly slide my div sections out to the left or right smoothly? Any help is greatly appreciated.

Link to comment
Share on other sites

For example - can anyone get this to work:<body><div style="position:relative; width:150px; height:170px; top:0px; left:0px;"> <div id="exampleHeader2" style="position:absolute; width:20px; height:150px; top:0px; left:0px; background:#3b587a; text-align:center; color:#FFFFFF;" onclick="slideExample2('examplePanel2', this);"> <<br /><<br />< </div> <div id="examplePanel2" style="position:absolute; width:130px; height:150px; top:0px; left:20px; background:#a6bbcd; overflow:hidden;"> Content </div></div></body><script type="text/javascript"> function slideExample2(elementId, headerElement) { var element = document.getElementById(elementId); if(element.up == null || element.down) { animate(elementId, 20, 0, 0, 150, 250, null); element.up = true; element.down = false; headerElement.innerHTML = '><br />><br />>'; } else { animate(elementId, 20, 0, 130, 150, 250, null); element.down = true; element.up = false; headerElement.innerHTML = '<<br /><<br /><'; }}</script>

Link to comment
Share on other sites

Hi,I'm not sure if this is what you are looking for, but you might be interested in jQuery, and than their function .animate():http://api.jquery.com/animate/and scroll down to approx half the page.Friendly regards,Maurice Krielaart

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...