Verticle Carousel jQuery -
I am trying to create a carousel, my first try is to try it first.
Holds HL, 2 images of each light both the width of 242 px and the height = 81 px deposits
Only 3 of the many lanes should be visible (i.e. 6 images Vizyla, as one has 2 images, Float: Each is left.)
UL: The block is set to display, whose width is 242px. HTML is fully displayed but the carousel does not work, as I know that I need to calculate above the cleverness, which is a lack of imitation.
& lt; Div id = "home_carousel" & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "# img1" class = "inline cboxElement" & gt; & Lt; Img src = "picture / home-truck 1.jpg" & gt; & Lt; / A & gt; & Lt; A href = "#" & gt; & Lt; IMG src = "picture / home-truck 1.jpg" & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; & Lt; IMG src = "picture / home-truck 1.jpg" & gt; & Lt; / A & gt; & Lt; A href = "#" & gt; & Lt; IMG src = "picture / home-truck 1.jpg" & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; & Lt; IMG src = "picture / home-truck 1.jpg" & gt; & Lt; / A & gt; & Lt; A href = "#" & gt; & Lt; IMG src = "picture / home-truck 1.jpg" & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; & Lt; IMG src = "picture / home-truck 1.jpg" & gt; & Lt; / A & gt; & Lt; A href = "#" & gt; & Lt; IMG src = "picture / home-truck 1.jpg" & gt; & Lt; / A & gt; & Lt; / Li & gt;
var myCarousel = {setHyight: function () {var $ img = $ ('li ',' #home_carousel '); Var Total = 81 * $ img.length; $ ('# Homecourse ul') Height (total); }, Slide: function () {var outPart = $ ('# home_carousel ul'). OuterHeight (); $ ('# Home_carousel_up') ('Click', function () {var $ a = $ (this); $ ('# home_carousel ul'). Chetan ({top: -81 + outPart + 'px'}, 500, 'rest atbans'); }); $ ('# Home_carousel_down') ('Click', function () {var $ a = $ (this); $ ('# home_carousel ul'). ({Top: 81 + 'px'}, 500, 'rayoutbounce');}); }, Init: function () {this.setHyight (); This.slide (); }}; MyCarousel.init ();
Try
I wrote all the arguments for the top offset And
($ ('# home_carousel ul'). Position (). Top - 81) and gt; ; (242 - outpant)
and when the situation needs to scroll down:
$ ('# home_carousel ul'). Event (). Top + 81 & Lt; = 0 I have crashed all the values. Please store the numbers 81 and 242 (height of the cover) in the variable. If you calculate the heights of Jquery If done through the OterHeight method then it would be great. In that case, if the height changes due to changes in your markup or CSS, your code will not break.
Comments
Post a Comment