3

I am looking to achieve a hide/show div where on mouse enter the div is shown but in a sliding left to right manner with easing.

Also i need the page to focus on the new div that just slided out / made visible.

Here is my script.

Any ideas on what i need to add?

<script>$("#box0").mouseenter(function () {
    $("#lSection2").show('slide').delay(5000); 
    $("#boxContent0").slideDown(3000);
    $("#boxContent0").focus();

});

$('#boxContent0').mouseleave(function() {
    $("#boxContent0").fadeOut(1000);     
    $("#lSection2").fadeOut(1000);
});</script>

 <div class="AdBox" id="box0">mouse over or click to view details</div>



 <div id="lSection2" style="display:none;"><div id="boxContent0"
 style="display:none;"  class="boxContent">
     <div align="left" style="">Win Big<br />
 - Ipad<br />
 - Holiday<br />
 - 1 Year Spa Treatments</div>
     <div></div>
Eno Bassey
  • 57
  • 1
  • 3
  • 11
  • You should improve the quality of your question for us to be able to help you. Can you please add what exactly you would like to achieve (you want some div to slide from left to right). What is it currently doing? You're talking about some `div`, but I don't see it in your question. Could you add your (relevant) HTML as well? It also helps to set up a demo. You can use http://jsfiddle.net for this. – PeeHaa Nov 14 '11 at 22:31

1 Answers1

2
$(element).show('slide', { direction: 'left' }, 1000);
$(element).hide('slide', { direction: 'left' }, 1000);

http://docs.jquery.com/UI/Effects/Slide

AlienWebguy
  • 76,997
  • 17
  • 122
  • 145
  • Sorry about not giving you more info earlier...i want to achieve that is currently on this site http://www.orisue.com i want to mouse over a div and another hidden div is shown sliding out under from left to right.... at the same time i want focus of the page to scroll to the current position of the new shown div. – Eno Bassey Nov 15 '11 at 07:05
  • This should get you started: http://jsfiddle.net/yfmXe/ Just add some user intent logic to prevent animation on fast mouseovers, etc. – AlienWebguy Nov 15 '11 at 18:47