I'm making a before and after image slider like on this page:

http://upstairsweb.com/Examples/slide-bar-example.html

But I would like to have the slider already halfway the image when you visit the page. How can I accomplish this? What code do I need to add? I don't have a lot of work experience with JavaScript so hopefully someone can help me with this.

Here is the tutorial I'm following:

http://upstairsweb.com/blog/basic-jquery-beforeafter-photo-slide-bar

有帮助吗?

解决方案

Just add this code:

$(".topImage").css('width', '50%');

Look here http://jsfiddle.net/sbxmal/4fZWA/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top