Tuesday, 10 September 2013

postion to left using position or offset

postion to left using position or offset

I'm using a plugin for image slider and there is not navigation buttons
like this O O O O. So I wanted to make using jquery and having a problem.
I want to take the picture to left of the div. So here is summarized
article with a demo:
html
<div id="banner">
<img class="img1" src="" />
<img class="img2" src="" />
<img class="img3" src="" />
<img class="img4" src="" />
</div>
<ul>
<li class='li1'>one</li>
<li class='li2'>two</li>
<li class='li3'>three</li>
<li class='li4'>four</li>
</ul>
jquery
$('.li4').click(function(){
$('.img4').offset().left;
});
I tried with animate, position, offset and scroll techniques but didn't
result what I want. But also I think I should use scroll method for the
slider. How can I achieve that?
demo



.img4 should be shown at left of the div when clicked to .li4

No comments:

Post a Comment