jssor slider transition dont work - slider
I have problem with jssor slider. It only show me first photo. I think the problem is in the responsive code.
I want make full width and full height slider, also fully responsive. When open on smaller devices it cut photo. Please help.
Please help.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Slider with Slideshow Example - Jssor Slider, Slideshow with Javascript Source Code</title>
</head>
<body style="background:#fff;">
<!-- it works the same with all jquery version from 1.x to 2.x -->
<script type="text/javascript" src="../js/jquery-1.9.1.min.js"></script>
<!-- use jssor.slider.mini.js (39KB) or jssor.sliderc.mini.js (31KB, with caption, no slideshow) or jssor.sliders.mini.js (26KB, no caption, no slideshow) instead for release -->
<!-- jssor.slider.mini.js = jssor.sliderc.mini.js = jssor.sliders.mini.js = (jssor.core.js + jssor.utils.js + jssor.slider.js) -->
<script type="text/javascript" src="../js/jssor.core.js"></script>
<script type="text/javascript" src="../js/jssor.utils.js"></script>
<script type="text/javascript" src="../js/jssor.slider.js"></script>
<script>
jQuery(document).ready(function ($) {
//Reference http://www.jssor.com/development/slider-with-slideshow-jquery.html
//Reference http://www.jssor.com/development/tool-slideshow-transition-viewer.html
var _SlideshowTransitions = [
//Fade
{$Duration:1200,x:1,$Delay:50,$Cols:8,$Rows:4,$Easing:{$Left:$JssorEasing$.$EaseInCubic,$Opacity:$JssorEasing$.$EaseOutQuad},$Opacity:2}
];
var options = {
$SlideDuration: 800, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500
$DragOrientation: 3, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0)
$AutoPlay: true, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false
$AutoPlayInterval: 1500, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000
$SlideshowOptions: { //[Optional] Options to specify and enable slideshow or not
$Class: $JssorSlideshowRunner$, //[Required] Class to create instance of slideshow
$Transitions: _SlideshowTransitions, //[Required] An array of slideshow transitions to play slideshow
$TransitionsOrder: 1, //[Optional] The way to choose transition to play slide, 1 Sequence, 0 Random
$ShowLink: true //[Optional] Whether to bring slide link on top of the slider when slideshow is running, default value is false
}
};
var jssor_slider1 = new $JssorSlider$("slider1_container", options);
});
//responsive code begin
//you can remove responsive code if you don't want the slider scales while window resizes
function ScaleSlider() {
var windowWidth = $(window).width();
if (windowWidth) {
var windowHeight = $(window).height();
var originalWidth = jssor_slider1.$OriginalWidth();
var originalHeight = jssor_slider1.$OriginalHeight();
var scaleWidth = windowWidth;
if (originalWidth / windowWidth > originalHeight / windowHeight) {
scaleWidth = Math.ceil(windowHeight / originalHeight * originalWidth);
}
jssor_slider1.$ScaleWidth(scaleWidth);
}
else
window.setTimeout(ScaleSlider, 30);
}
ScaleSlider();
$(window).bind("load", ScaleSlider);
$(window).bind("resize", ScaleSlider);
$(window).bind("orientationchange", ScaleSlider);
//responsive code end
</script>
<!-- Jssor Slider Begin -->
<!-- You can move inline styles to css file or css block. -->
<!-- ORIGINAL SLIDER!!!!!!!!!!!!!
<div id="slider1_container" style="position: relative; width: 600px;
height: 300px;"> END!!!!!!!!!!!!!!!!!!!! -->
<div style="position: relative; width: 100%; overflow: hidden;">
<div style="position: relative; left: 50%; width: 5000px; text-align: center; margin-left: -2500px;">
<!-- use 'margin: 0 auto;' to auto center element in parent container -->
<div id="slider1_container" style="margin: 0 auto;" >
</div>
</div>
</div>
<!-- Loading Screen -->
<div u="loading" style="position: absolute; top: 0px; left: 0px;">
<div style="filter: alpha(opacity=70); opacity:0.7; position: absolute; display: block;
background-color: #000; top: 0px; left: 0px;width: 100%;height:100%;">
</div>
<div style="position: absolute; display: block; background: url(../img/loading.gif) no-repeat center center;
top: 0px; left: 0px;width: 100%;height:100%;">
</div>
</div>
<!-- Slides Container -->
<div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; height: 100%;
overflow: hidden;">
<div>
<img u=image src="../img/landscape/01.png" />
</div>
<div>
<img u=image src="../img/landscape/02.png" />
</div>
<div>
<img u=image src="../img/landscape/03.jpg" />
</div>
<div>
<img u=image src="../img/landscape/04.jpg" />
</div>
</div>
<a style="display: none" href="http://www.jssor.com">jquery content slider</a>
</div>
</body>
</html>
See http://www.jssor.com/testcase/full-screen-slider.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Slider with Slideshow Example - Jssor Slider, Slideshow with Javascript Source Code</title>
</head>
<body style="background:#fff; margin: 0px; overflow: hidden;">
<!-- it works the same with all jquery version from 1.x to 2.x -->
<script type="text/javascript" src="../js/jquery-1.9.1.min.js"></script>
<!-- use jssor.slider.mini.js (39KB) or jssor.sliderc.mini.js (31KB, with caption, no slideshow) or jssor.sliders.mini.js (26KB, no caption, no slideshow) instead for release -->
<!-- jssor.slider.mini.js = jssor.sliderc.mini.js = jssor.sliders.mini.js = (jssor.core.js + jssor.utils.js + jssor.slider.js) -->
<script type="text/javascript" src="../js/jssor.core.js"></script>
<script type="text/javascript" src="../js/jssor.utils.js"></script>
<script type="text/javascript" src="../js/jssor.slider.js"></script>
<script>
jQuery(document).ready(function ($) {
//Reference http://www.jssor.com/development/slider-with-slideshow-jquery.html
//Reference http://www.jssor.com/development/tool-slideshow-transition-viewer.html
var _SlideshowTransitions = [
//Fade
{ $Duration: 1200, x: 1, $Delay: 50, $Cols: 8, $Rows: 4, $Easing: { $Left: $JssorEasing$.$EaseInCubic, $Opacity: $JssorEasing$.$EaseOutQuad }, $Opacity: 2 }
];
var options = {
$SlideDuration: 800, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500
$DragOrientation: 3, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0)
$AutoPlay: true, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false
$AutoPlayInterval: 1500, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000
$SlideshowOptions: { //[Optional] Options to specify and enable slideshow or not
$Class: $JssorSlideshowRunner$, //[Required] Class to create instance of slideshow
$Transitions: _SlideshowTransitions, //[Required] An array of slideshow transitions to play slideshow
$TransitionsOrder: 1, //[Optional] The way to choose transition to play slide, 1 Sequence, 0 Random
$ShowLink: true //[Optional] Whether to bring slide link on top of the slider when slideshow is running, default value is false
}
};
var jssor_slider1 = new $JssorSlider$("slider1_container", options);
//responsive code begin
//you can remove responsive code if you don't want the slider scales while window resizes
function ScaleSlider() {
var windowWidth = $(window).width();
if (windowWidth) {
var windowHeight = $(window).height();
var originalWidth = jssor_slider1.$OriginalWidth();
var originalHeight = jssor_slider1.$OriginalHeight();
var scaleWidth = windowWidth;
if (originalWidth / windowWidth > originalHeight / windowHeight) {
scaleWidth = Math.ceil(windowHeight / originalHeight * originalWidth);
}
jssor_slider1.$ScaleWidth(scaleWidth);
}
else
window.setTimeout(ScaleSlider, 30);
}
ScaleSlider();
$(window).bind("load", ScaleSlider);
$(window).bind("resize", ScaleSlider);
$(window).bind("orientationchange", ScaleSlider);
//responsive code end
});
</script>
<div style="position: relative; width: 100%; overflow: hidden;">
<div style="position: relative; left: 50%; width: 5000px; text-align: center; margin-left: -2500px;">
<!-- Jssor Slider Begin -->
<!-- You can move inline styles to css file or css block. -->
<div id="slider1_container" style="position: relative; margin: 0 auto; top: 0px; left: 0px; width: 600px; height: 300px;">
<!-- Loading Screen -->
<div u="loading" style="position: absolute; top: 0px; left: 0px;">
<div style="filter: alpha(opacity=70); opacity:0.7; position: absolute; display: block;
background-color: #000; top: 0px; left: 0px;width: 100%;height:100%;">
</div>
<div style="position: absolute; display: block; background: url(../img/loading.gif) no-repeat center center;
top: 0px; left: 0px;width: 100%;height:100%;">
</div>
</div>
<!-- Slides Container -->
<div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 600px; height: 300px;
overflow: hidden;">
<div>
<img u=image src="../img/landscape/01.jpg" />
</div>
<div>
<img u=image src="../img/landscape/02.jpg" />
</div>
<div>
<img u=image src="../img/landscape/03.jpg" />
</div>
<div>
<img u=image src="../img/landscape/04.jpg" />
</div>
</div>
<a style="display: none" href="http://www.jssor.com">jquery content slider</a>
</div>
</div>
</div>
</body>
</html>
Related
how to animate div box from left to right or right to left when scroll web page
i want to animate div box from left to righ and right to left. suppose i have a 2 box with bootstrap classes`example : <div class="container"> <div class="row"> <div class="col-md-6 id="leftToRight"></div> <div class="col-md-6 id="RightToLeft"></div> </div> </div> now i want to animate #leftToRight id from left to right and #RightToLeft from righ to left. when scroll web page. I see many website in which this type of animation is applied. I am very curious to know how it is happen.
You can use the wheel event to answer your question: $(function() { $(window).on('wheel', function(e) { var delta = e.originalEvent.deltaY; if (delta > 0) //On scroll down { $('#RightToLeft').animate({ left: "-=10px" },5); $('#LeftToRight').animate({ left: "+=10px" },5); } else //This is added for reverse animation on scroll up { $('#RightToLeft').animate({ left: "+=10px" },5); $('#LeftToRight').animate({ left: "-=10px" },5); } return false; // this line is only added so the whole page won't scroll in the demo }); }); #RightToLeft{ position: relative; margin: auto; background: red; width: 100px; height: 100px; } #LeftToRight{ position: relative; margin: auto; background: blue; width: 100px; height: 100px; } .row{ margin: auto; width:90%; overflow: hidden; background: grey; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="container"> <div class="row"> <div class="col-md-6" id="LeftToRight">Left to Right</div> <div class="col-md-6" id="RightToLeft">Right to Left</div> </div> </div>
Bxslider slider shown only one slide
Bxslider slider shown only one slide, space between slider is very big or what is problem i can't figure out it shows 1 slide after scorollin 2nd slide e.t.c. but i want to 5 slidere scrolling alway like carousel .bx-wrapper { position: relative; margin: 0 auto 20px; padding: 0; *zoom: 1; width: 780px; height: 100px; } .bx-wrapper img { max-width: 20%; display: block; } /** THEME ===================================*/ .bx-wrapper .bx-viewport { -moz-box-shadow: 0 0 5px #fff; -webkit-box-shadow: 0 0 5px #fff; box-shadow: 0 0 5px #fff; border: 5px solid #fff; left: -5px; background: #fff; } Thanks!
this sample, i need auto too, in this example, http://bxslider.com/examples/carousel-dynamic-number-slides SCRIPT <script type="text/javascript"> $(document).ready(function(){ $('.bxslider').bxSlider(); }); </script> HTML <ul class="bxslider"> <li><img src="images/logo1" /></li> <li><img src="images/logo2" /></li> <li><img src="images/logo3" /></li> <li><img src="images/logo4" /></li> </ul> <!-- jQuery library (served from Google) --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <!-- bxSlider Javascript file --> <script src="/js/bxslider/jquery.bxslider.min.js"></script> <!-- bxSlider CSS file --> <link href="/js/bxslider/jquery.bxslider.css" rel="stylesheet" />
Strange thing, I added your code, now no scrolling and everything is vertical not horizontal. I'm edited before something, but not js, I think something going wrong, but can't figure out <script type="text/javascript"> $(function() { var bx = $('.bx').bxSlider({ auto: true, autoControls: true, minSlides: 5, maxSlides: 5, moveSlides: 5, slideWidth: 120 }) }) </script>
Jssor slider loading time
I have added multiple instances of "jssor slider" for product carousel in a single page, its working fine but when I refresh the page it takes a lot of time to load the carousel on homepage how can I reduce the loading time of carousel? <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Carousel Demo - Jssor Slider, Carousel, Slideshow with Javascript Source Code</title> </head> <body style="font-family:Arial, Verdana;background-color:#fff;"> <!-- it works the same with all jquery version from 1.x to 2.x --> <script type="text/javascript" src="examples/js/jquery-1.9.1.min.js"></script> <!-- use jssor.slider.mini.js (40KB) instead for release --> <!-- jssor.slider.mini.js = (jssor.js + jssor.slider.js) --> <script type="text/javascript" src="examples/js/jssor.js"></script> <script type="text/javascript" src="examples/js/jssor.slider.js"></script> <script> jQuery(document).ready(function ($) { var options = { $AutoPlay: true, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false $AutoPlaySteps: 1, //[Optional] Steps to go for each navigation request (this options applys only when slideshow disabled), the default value is 1 $AutoPlayInterval: 4000, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000 $PauseOnHover: 1, //[Optional] Whether to pause when mouse over if a slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause for touch device, 3 pause for desktop and touch device, 4 freeze for desktop, 8 freeze for touch device, 12 freeze for desktop and touch device, default value is 1 $ArrowKeyNavigation: true, //[Optional] Allows keyboard (arrow key) navigation or not, default value is false $SlideDuration: 160, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500 $MinDragOffsetToSlide: 20, //[Optional] Minimum drag offset to trigger slide , default value is 20 $SlideWidth: 200, //[Optional] Width of every slide in pixels, default value is width of 'slides' container //$SlideHeight: 150, //[Optional] Height of every slide in pixels, default value is height of 'slides' container $SlideSpacing: 3, //[Optional] Space between each slide in pixels, default value is 0 $DisplayPieces: 4, //[Optional] Number of pieces to display (the slideshow would be disabled if the value is set to greater than 1), the default value is 1 $ParkingPosition: 0, //[Optional] The offset position to park slide (this options applys only when slideshow disabled), default value is 0. $UISearchMode: 1, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, arrow navigator container, thumbnail navigator container etc). $PlayOrientation: 1, //[Optional] Orientation to play slide (for auto play, navigation), 1 horizental, 2 vertical, 5 horizental reverse, 6 vertical reverse, default value is 1 $DragOrientation: 1, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0) $BulletNavigatorOptions: { //[Optional] Options to specify and enable navigator or not $Class: $JssorBulletNavigator$, //[Required] Class to create navigator instance $ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always $AutoCenter: 0, //[Optional] Auto center navigator in parent container, 0 None, 1 Horizontal, 2 Vertical, 3 Both, default value is 0 $Steps: 1, //[Optional] Steps to go for each navigation request, default value is 1 $Lanes: 1, //[Optional] Specify lanes to arrange items, default value is 1 $SpacingX: 0, //[Optional] Horizontal space between each item in pixel, default value is 0 $SpacingY: 0, //[Optional] Vertical space between each item in pixel, default value is 0 $Orientation: 1 //[Optional] The orientation of the navigator, 1 horizontal, 2 vertical, default value is 1 }, $ArrowNavigatorOptions: { $Class: $JssorArrowNavigator$, //[Requried] Class to create arrow navigator instance $ChanceToShow: 1, //[Required] 0 Never, 1 Mouse Over, 2 Always $AutoCenter: 2, //[Optional] Auto center navigator in parent container, 0 None, 1 Horizontal, 2 Vertical, 3 Both, default value is 0 $Steps: 1 //[Optional] Steps to go for each navigation request, default value is 1 } }; var jssor_slider1 = new $JssorSlider$('slider1_container', options); //responsive code begin //you can remove responsive code if you don't want the slider scales while window resizes function ScaleSlider() { var bodyWidth = document.body.clientWidth; if (bodyWidth) jssor_slider1.$ScaleWidth(Math.min(bodyWidth, 809)); else window.setTimeout(ScaleSlider, 30); } ScaleSlider(); $(window).bind("load", ScaleSlider); $(window).bind("resize", ScaleSlider); $(window).bind("orientationchange", ScaleSlider); //responsive code end }); </script> <!-- Jssor Slider Begin --> <!-- To move inline styles to css file/block, please specify a class name for each element. --> <div id='slider1_container' style="position: relative; top: 0px; left: 0px; width: 100%; height: 350px; overflow: hidden;"> <!-- Loading Screen --> <div u="loading" style="position: absolute; top: 0px; left: 0px;"> <div style="filter: alpha(opacity=70); opacity:0.7; position: relative; display: block; background-color: #000; top: 0px; left: 0px;width: 100%;height:100%;"> </div> <div style="position: absolute; display: block; background: url(examples/img/loading.gif) no-repeat center center; top: 0px; left: 0px;width: 100%;height:100%;"> </div> </div> <!-- Slides Container --> <div u="slides" style="cursor: move; position: absolute; left: 100px; top: 0px; width: 100%; height: 350px; overflow: hidden;"> <?php $i=0; foreach ($_products->getItems() as $_product): ?> <?php $_products = $this->getProductCollection(); ?> <?php $_collectionSize = sizeof($_products); ?> <?php $_columnCount = Mage::getStoreConfig('homepage/options/count'); ?> <div class="block-content" > <?php if (sizeof($_products)): ?> <?php if ($i++%$_columnCount==10): ?> <ul class="products-grid"> <?php endif ?> <?php // echo $_product->getData('is_salable') . Mage::getStoreConfig('homepage/options/salable'); ?> <?php if ($_product->getData('is_salable')): ?> <li class="item<?php if($i==sizeof($_products) ): ?> last<?php endif; ?>"> <img src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->resize(1930); ?>" width="100%" height="140" alt="" /> <div class="product-details"> <p class="product-name"><?php echo $this->htmlEscape($_product->getName()) ?></p> <?php if (Mage::getStoreConfig('homepage/options/price')):?> <?php echo $this->getPriceHtml($_product, true) ?> <?php endif; ?> <?php if (Mage::getStoreConfig('homepage/options/actions')):?> <a class="link-cart" href="<?php echo $this->getAddToCartUrl($_product) ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->__('Add to Cart') ?></a> <?php endif; ?> </div> </li> <?php else: ?> <?php if( Mage::getStoreConfig('homepage/options/salable')) : ?> <li class="item"> <img src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->resize(1930); ?>" width="130" height="130" alt="" /> <div class="product-details"> <p class="product-name"><?php echo $this->htmlEscape($_product->getName()) ?></p> <?php if (Mage::getStoreConfig('homepage/options/price')):?> <?php echo $this->getPriceHtml($_product, true) ?> <?php endif; ?> <?php if (Mage::getStoreConfig('homepage/options/actions')):?> <a class="link-cart" href="<?php echo $this->getAddToCartUrl($_product) ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->__('Add to Cart ') ?></a> <?php endif; ?> </div> </li> <?php endif; ?> <?php endif; ?> <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?> </ul> <?php endif ?> <?php else: ?> <ol id="bestseller-sidebar" class="mini-products-list"> <li class="item odd"> <?php echo Mage::getStoreConfig('homepage/options/noproduct') ?> </li> </ol> <?php endif; ?> </div> <?php endforeach; ?> </div> <!--#region Bullet Navigator Skin Begin --> <!-- Help: http://www.jssor.com/development/slider-with-bullet-navigator-jquery.html --> <style> /* jssor slider bullet navigator skin 03 css */ /* .jssorb03 div (normal) .jssorb03 div:hover (normal mouseover) .jssorb03 .av (active) .jssorb03 .av:hover (active mouseover) .jssorb03 .dn (mousedown) */ .jssorb03 { position: absolute; } .jssorb03 div, .jssorb03 div:hover, .jssorb03 .av { position: absolute; /* size of bullet elment */ width: 21px; height: 21px; text-align: center; line-height: 21px; color: white; font-size: 12px; background: url(examples/img/b03.png) no-repeat; overflow: hidden; cursor: pointer; } .jssorb03 div { background-position: -5px -4px; } .jssorb03 div:hover, .jssorb03 .av:hover { background-position: -35px -4px; } .jssorb03 .av { background-position: -65px -4px; } .jssorb03 .dn, .jssorb03 .dn:hover { background-position: -95px -4px; } </style> <!-- bullet navigator container --> <!--#endregion Bullet Navigator Skin End --> <!--#region Arrow Navigator Skin Begin --> <!-- Help: http://www.jssor.com/development/slider-with-arrow-navigator-jquery.html --> <style> /* jssor slider arrow navigator skin 03 css */ /* .jssora03l (normal) .jssora03r (normal) .jssora03l:hover (normal mouseover) .jssora03r:hover (normal mouseover) .jssora03l.jssora03ldn (mousedown) .jssora03r.jssora03rdn (mousedown) */ .jssora03l, .jssora03r { display: block; position: absolute; /* size of arrow element */ width: 55px; height: 55px; cursor: pointer; background: url(examples/img/a03.png) no-repeat; overflow: hidden; } .jssora03l { background-position: -3px -33px; } .jssora03r { background-position: -63px -33px; } .jssora03l:hover { background-position: -123px -33px; } .jssora03r:hover { background-position: -183px -33px; } .jssora03l.jssora03ldn { background-position: -243px -33px; } .jssora03r.jssora03rdn { background-position: -303px -33px; } </style> <!-- Arrow Left --> <span u="arrowleft" class="jssora03l" style="top: 123px; left: 8px;"> </span> <!-- Arrow Right --> <span u="arrowright" class="jssora03r" style="top: 123px; right: 8px;"> </span> <!--#endregion Arrow Navigator Skin End --> <a style="display: none" href="http://www.jssor.com">Bootstrap Slider</a> </div> <!-- Jssor Slider End --> </body> </html>
jssor carousel Having an Issue
I need simple horizontal no-autoplay carousel where images are of various width but same height (117px). I need to see continuous multiple images (depending on their width) in the container separated by, say, 5px. Much like oriental lady example on jssor.com. What I get (see below code) is perfectly working carousel, BUT only displaying single image per slide. What do I need to do/set to get multiple images per slide please? <script src="../js/jquery-1.9.1.min.js"></script> <script src="../js/jssor.slider.min.js"></script> <script> jQuery(document).ready(function (\$) { var options = { \$AutoPlay: false, \$Loop: 0, }; var jssor_slider2 = new \$JssorSlider\$('slider2_container', options); }); </script> <div id="slider2_container" style="position: relative; top: 0px; left: 0px; width: 300; height: 117;"> <!-- Slides Container --> <div u="slides" style="cursor: move; position: relative; overflow: hidden; left: 0px; top: 0px; width:300; height: 117"> <div> <img src="$imgpath/msummer2015.jpg"> <p>Marklin Summer 2015</p> </div> <div> <img src="$imgpath/m2015.jpg"> <p>Marklin 2015</p> </div> <div> <img src="$imgpath/roco2015.jpg"> <p>Roco 2015</p> </div> <div> <img src="$`enter code here`imgpath/fl2015.jpg"> <p>Fleischmann 2015</p> </div> </div> </div>
First of all, please define your slider size in pixel (300px, 117px). Note that every slide should be in fixed size. Given a slider in size 300 x 117, you can display 2 or more slides in the slides container. Please set $SlideWidth, $DisplayPieces, $SlideSpacing options. var options = { $AutoPlay: false, $Loop: 0, $SlideWidth: 150, $DisplayPieces: 2, //or more if you like $SlideSpacing: 0 };
How to fill a div with a class col-md-8 in bootstrap and jssor?
I want that the images container in the jssor component fill the div with a class col-md-8. I tried delete width and height, change the position attribute, doesn't work with percent nor auto attributes, most of the time the image disappear. Is there a way to do this?? <div class="col-md-8"> <div id="slider1_container" class="" style="position: relative; top: 0px; left: 0px; width: 650px; height: 350px;"> <!-- Slides Container --> <div data-u="slides" class="" style="cursor: move; position: relative; overflow: hidden; left: 0px; top: 0px; width: 650px; height: 350px;"> #foreach (var image in Model.RandomAlbum.Images) { <div><img src="~/Content/uploads/original/#image.Name" data-u="image" class="img-responsive" /></div> } </div> </div> </div>
Jssor slider is specified with fixed size, but you can scale it to any size by calling api $ScaleWidth. Use the following code, you can fit the slider in parent container. //responsive code begin //you can remove responsive code if you don't want the slider scales //while window resizes function ScaleSlider() { var parentWidth = $('#slider1_container').parent().width(); if (parentWidth) { jssor_slider1.$ScaleWidth(parentWidth); } else window.setTimeout(ScaleSlider, 30); } //Scale slider after document ready ScaleSlider(); //Scale slider while window load/resize/orientationchange. $(window).bind("load", ScaleSlider); $(window).bind("resize", ScaleSlider); $(window).bind("orientationchange", ScaleSlider); //responsive code end Reference: http://www.jssor.com/development/tip-make-responsive-slider.html