Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slide div horizontally with easing

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>
like image 311
Eno Bassey Avatar asked Jun 30 '26 18:06

Eno Bassey


1 Answers

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

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

like image 96
AlienWebguy Avatar answered Jul 02 '26 08:07

AlienWebguy