{"id":1747,"date":"2010-11-15T10:24:58","date_gmt":"2010-11-15T10:24:58","guid":{"rendered":"http:\/\/mts-help.nick.php.dev\/after_sale_support\/jquery\/slider\/article5.html"},"modified":"2020-02-03T03:56:39","modified_gmt":"2020-02-03T08:56:39","slug":"before-after-slider","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/before-after-slider.html","title":{"rendered":"&#8220;Before-After&#8221; Slider"},"content":{"rendered":"<p>This is a Slider Script that allows you to show two images in a single container and drag one image over another which is good for \u201cbefore-after\u201d comparison.<\/p> <p>This plug-in has several important advantages: <br \/>\u2022&nbsp;Low file size (only 7 Kbytes); <br \/>\u2022&nbsp;You can use it many times on the same page; <br \/>\u2022&nbsp;When JavaScript is disabled you will not lose a container, it will just show the first image.<\/p> <p> <strong>JavaScript <br \/><\/strong> In order to make the script work, the <strong>index-#.html<\/strong> file with a slider should contain these lines of HTML code:<\/p> <p>The <strong>&lt;head&gt;<\/strong> section of the <strong>index-#.html<\/strong> file contains these lines of code that initialize the script functionality with basic values:<\/p> <p>If you want to set specific attributes for the slider you will need to define them when you initialize the plug-in.<\/p> <\/p> <p>Here the script attributes define the following values: <br \/>\u2022&nbsp; <strong>animateIntro<\/strong> &ndash; if this attribute is set to true, the slider will slowly move&nbsp;(<strong>false<\/strong> by default); <br \/>\u2022&nbsp; <strong>introDelay: 2000<\/strong> &ndash; if <strong>animateIntro<\/strong> is set to <strong>true<\/strong>, this attribute defines a delay before the animation starts; <br \/>\u2022&nbsp; <strong>introDuration: 500<\/strong> &ndash; if <strong>animateIntro<\/strong> is set to <strong>true<\/strong>, this attribute defines total animation time; <br \/>\u2022&nbsp; <strong>showFullLinks: false<\/strong> &ndash; defines whether to show the links that allow to see full images (&#8220;before&#8221; or &#8220;after&#8221;) at once.<\/p> <p> <strong>HTML<\/strong> <br \/>In order to create a slider you will need to define two images that have fixed width and height. <br \/>Below you can see the HTML script representation:<\/p> <p> <strong>CSS<\/strong> <br \/>You can find script related stylesheet in the main <strong>style.css<\/strong> file. You will need to modify the following styles:<\/p> <p>Make sure to set <strong>overflow: hidden;<\/strong> for <strong>#container<\/strong> id.<\/p>","protected":false},"excerpt":{"rendered":"<p>This is a Slider Script that allows you to show two images in a single container and drag one image over another which is good for \u201cbefore-after\u201d comparison. This plug-in has several important advantages: \u2022&nbsp;Low file size (only 7 Kbytes); \u2022&nbsp;You can use it many times on the same page; \u2022&nbsp;When JavaScript is disabled you [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[262],"tags":[813,816],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/1747"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=1747"}],"version-history":[{"count":5,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/1747\/revisions"}],"predecessor-version":[{"id":86236,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/1747\/revisions\/86236"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=1747"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=1747"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=1747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}