Помогите Поставить Слайдер Интересных Предложений
#301
Отправлено 28 Сентябрь 2013 - 22:52
#302
Отправлено 29 Сентябрь 2013 - 00:08
Содержимое архива нужно загрузить на сайт.
Теперь откройте шаблон HTML.
После кода:
<!-- Скрипты магазина --> <script type="text/javascript" src="{ASSETS_JS_PATH}main.js"></script>
Вставьте код -
<script type="text/javascript" src="{ASSETS_JS_PATH}jquery.jcarousel.js"></script> <link rel="stylesheet" href="{ASSETS_STYLES_PATH}carousel.css" type="text/css" />
Теперь зайдите в шаблон Товар и найдите код
<ul class="row products-grid"> {% FOR related_goods %} <li class="span3 item"> <div class="product-box"> {% IF user_agent_ie7 %} <a href="{related_goods.URL | url_amp}" title="{related_goods.NAME}" > <div class="product-image"><img src="{% IF related_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png{% ELSE %}{related_goods.IMAGE_SMALL}{% ENDIF %}"></div> </a> {% ELSEIF user_agent_ie8 %} <a href="{related_goods.URL | url_amp}" title="{related_goods.NAME}" > <div class="product-image"><img src="{% IF related_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png{% ELSE %}{related_goods.IMAGE_SMALL}{% ENDIF %}"></div> </a> {% ELSE %} <div class="span12"> <a href="{related_goods.URL | url_amp}" title="{related_goods.NAME}" > <div class="product-image" style="background: url('{% IF related_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png{% ELSE %}{related_goods.IMAGE_SMALL}{% ENDIF %}') no-repeat center center; background-size: contain;"></div> </a> </div> {% ENDIF %}[/size][/font] [font=tahoma, helvetica, arial, sans-serif][size=3] <div class="quick-shop"> <div class="bg-quick-shop"> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="goodsListItemCatalogueAddToCartButton product-form-{related_goods.MIN_PRICE_NOW_ID}"> <div> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{related_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{related_goods.MIN_PRICE_NOW_ID}" /> <a onclick="$('.product-form-{related_goods.MIN_PRICE_NOW_ID}').attr('rel', 'quick').submit();return false;" title="Быстро оформить заказ"> </a> </div> </form> </div> </div> <h2 class="product-name"><a href="{related_goods.URL | url_amp}" title="{related_goods.NAME}">{related_goods.NAME}</a></h2> <div class="span12 {% IF related_goods.MIN_PRICE_NOW>=related_goods.MIN_PRICE_OLD %}price-box-for-regular-price{% ELSE %}price-box{% ENDIF %}" > <span class="regular-price"> <span class="price">{related_goods.MIN_PRICE_NOW | money_format}</span> </span> {% IF related_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>related_goods.MIN_PRICE_NOW %} <span class="old-price" style="padding-left:5px;"> <span class="price">{related_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT | money_format}</span> </span> {% ELSEIF related_goods.MIN_PRICE_OLD>related_goods.MIN_PRICE_NOW %} <span class="old-price" style="padding-left:5px;"> <span class="price">{related_goods.MIN_PRICE_OLD | money_format}</span> </span> {% ENDIF %} </div> <div class="actions"> <button type="button" title="Добавить товар в корзину" class="btn btn-success2" onclick="$('.product-form-{related_goods.MIN_PRICE_NOW_ID}').submit();return false;">Добавить в корзину</button> <ul class="add-to-links"> <li><a href="{related_goods.URL | url_amp}" class="link-wishlist" title="Перейти на страницу информации о {related_goods.NAME}">Подробней</a></li> <!-- Если в тарифном плане подключен модуль сравнения товаров --> {% IF TARIFF_FEATURE_GOODS_COMPARE %} <!-- Если не выключен модуль сравнения товаров в настройках магазина --> {% IFNOT SETTINGS_COMPARE_DISABLE %} <li> <span class="separator">|</span> {% IF related_goods.IS_HAS_IN_COMPARE_LIST %} <a title="Убрать товар из списка сравнения с другими товарами" href="{COMPARE_DELETE_URL}?id={related_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" class="link-compare">убрать из сравнения</a> {% ELSE %} <a title="Добавить товар к списку сравнения с другими товарами" href="{COMPARE_ADD_URL}?id={related_goods.MIN_PRICE_NOW_ID}&from={related_goods.GOODS_FROM}&return_to={CURRENT_URL | urlencode}" class="link-compare">Сравнить</a> {% ENDIF %} </li> {% ENDIF %} {% ENDIF %} </ul> </div> </div> </li> {% ENDFOR %} </ul>
Замените этот код на -
<script type="text/javascript"> jQuery(document).ready(function() { // Initialise the first and second carousel by class selector. // Note that they use both the same configuration options (none in this case). jQuery('.d-carousel .carousel').jcarousel({ scroll: 1 }); }); </script> <!-- Begin Wrapper --> <div id="wrapper"><div class="d-carousel"> <ul class="carousel"> {% FOR related_goods %} <li> <a href="#"><img src="{% IF related_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png{% ELSE %}{related_goods.IMAGE_SMALL}{% ENDIF %}" alt="{related_goods.NAME}" /></a> <h4><a href="{related_goods.URL}">{related_goods.NAME}</a></h4> <p> <a href="{related_goods.URL_MIN_PRICE_NOW}">{related_goods.MIN_PRICE_NOW | money_format}</a> {% IF related_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>related_goods.MIN_PRICE_NOW %} <br /><a href="{related_goods.URL_MIN_PRICE_NOW_WITHOUT_DISCOUNT}" class="lineThrough">{related_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT | money_format}</a> {% ELSEIF related_goods.MIN_PRICE_OLD>related_goods.MIN_PRICE_NOW %} <br /><a href="{related_goods.URL_MIN_PRICE_OLD}" class="lineThrough">{related_goods.MIN_PRICE_OLD | money_format}</a>{% ENDIF %}</p> </li> {% ENDFOR related_goods %} </ul> </div> <div class="clear"></div> </div> <!-- End Wrapper -->
Прикрепленные файлы
#303
Отправлено 02 Ноябрь 2013 - 20:13
Script error. на строке: 0.
аккаунт SL-239533#304
Отправлено 03 Ноябрь 2013 - 06:57
ginger (02 Ноябрь 2013 - 20:13) писал:
Script error. на строке: 0.
аккаунт SL-239533Точно не знаю какой Вы выбрали вариант(первый или второй)
Допустим первый.
Скрипт нужно вставить в конец файла main.js -
$(function() { // the element we want to apply the jScrollPane var $el = $('#jp-container').jScrollPane({ verticalGutter : -16 }), // the extension functions and options extensionPlugin = { extPluginOpts : { // speed for the fadeOut animation mouseLeaveFadeSpeed : 500, // scrollbar fades out after hovertimeout_t milliseconds hovertimeout_t : 1000, // if set to false, the scrollbar will be shown on mouseenter and hidden on mouseleave // if set to true, the same will happen, but the scrollbar will be also hidden on mouseenter after "hovertimeout_t" ms // also, it will be shown when we start to scroll and hidden when stopping useTimeout : true, // the extension only applies for devices with width > deviceWidth deviceWidth : 980 }, hovertimeout : null, // timeout to hide the scrollbar isScrollbarHover: false,// true if the mouse is over the scrollbar elementtimeout : null, // avoids showing the scrollbar when moving from inside the element to outside, passing over the scrollbar isScrolling : false,// true if scrolling addHoverFunc : function() { // run only if the window has a width bigger than deviceWidth if( $(window).width() <= this.extPluginOpts.deviceWidth ) return false; var instance = this; // functions to show / hide the scrollbar $.fn.jspmouseenter = $.fn.show; $.fn.jspmouseleave = $.fn.fadeOut; // hide the jScrollPane vertical bar var $vBar = this.getContentPane().siblings('.jspVerticalBar').hide(); /* * mouseenter / mouseleave events on the main element * also scrollstart / scrollstop - @James Padolsey : http://james.padolsey.com/javascript/special-scroll-events-for-jquery/ */ $el.bind('mouseenter.jsp',function() { // show the scrollbar $vBar.stop( true, true ).jspmouseenter(); if( !instance.extPluginOpts.useTimeout ) return false; // hide the scrollbar after hovertimeout_t ms clearTimeout( instance.hovertimeout ); instance.hovertimeout = setTimeout(function() { // if scrolling at the moment don't hide it if( !instance.isScrolling ) $vBar.stop( true, true ).jspmouseleave( instance.extPluginOpts.mouseLeaveFadeSpeed || 0 ); }, instance.extPluginOpts.hovertimeout_t ); }).bind('mouseleave.jsp',function() { // hide the scrollbar if( !instance.extPluginOpts.useTimeout ) $vBar.stop( true, true ).jspmouseleave( instance.extPluginOpts.mouseLeaveFadeSpeed || 0 ); else { clearTimeout( instance.elementtimeout ); if( !instance.isScrolling ) $vBar.stop( true, true ).jspmouseleave( instance.extPluginOpts.mouseLeaveFadeSpeed || 0 ); } }); if( this.extPluginOpts.useTimeout ) { $el.bind('scrollstart.jsp', function() { // when scrolling show the scrollbar clearTimeout( instance.hovertimeout ); instance.isScrolling = true; $vBar.stop( true, true ).jspmouseenter(); }).bind('scrollstop.jsp', function() { // when stop scrolling hide the scrollbar (if not hovering it at the moment) clearTimeout( instance.hovertimeout ); instance.isScrolling = false; instance.hovertimeout = setTimeout(function() { if( !instance.isScrollbarHover ) $vBar.stop( true, true ).jspmouseleave( instance.extPluginOpts.mouseLeaveFadeSpeed || 0 ); }, instance.extPluginOpts.hovertimeout_t ); }); // wrap the scrollbar // we need this to be able to add the mouseenter / mouseleave events to the scrollbar var $vBarWrapper = $('<div/>').css({ position : 'absolute', left : $vBar.css('left'), top : $vBar.css('top'), right : $vBar.css('right'), bottom : $vBar.css('bottom'), width : $vBar.width(), height : $vBar.height() }).bind('mouseenter.jsp',function() { clearTimeout( instance.hovertimeout ); clearTimeout( instance.elementtimeout ); instance.isScrollbarHover = true; // show the scrollbar after 100 ms. // avoids showing the scrollbar when moving from inside the element to outside, passing over the scrollbar instance.elementtimeout = setTimeout(function() { $vBar.stop( true, true ).jspmouseenter(); }, 100 ); }).bind('mouseleave.jsp',function() { // hide the scrollbar after hovertimeout_t clearTimeout( instance.hovertimeout ); instance.isScrollbarHover = false; instance.hovertimeout = setTimeout(function() { // if scrolling at the moment don't hide it if( !instance.isScrolling ) $vBar.stop( true, true ).jspmouseleave( instance.extPluginOpts.mouseLeaveFadeSpeed || 0 ); }, instance.extPluginOpts.hovertimeout_t ); }); $vBar.wrap( $vBarWrapper ); } } }, // the jScrollPane instance jspapi = $el.data('jsp'); // extend the jScollPane by merging $.extend( true, jspapi, extensionPlugin ); jspapi.addHoverFunc(); });
код карусели -
<div id="jp-container" class="jp-container"> <a target="_blank" href="http://tympanus.net/codrops/2011/09/20/responsive-image-gallery/"> <img src="images/thumbs/16.jpg"/> <div> <h3>Responsive Image Gallery with Thumbnail Carousel</h3> A tutorial on how to create a responsive image gallery with a thumbnail carousel using Elastislide. Inspired by Twitter's "user gallery" and upon a request to show an integration of Elastislide, we want to implement a responsive gallery that adapts to the view-port width. The gallery will have a view switch that allows to view it with the thumbnail carousel or without. We'll also add the possibility to navigate with the keyboard. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/09/12/elastislide-responsive-carousel/"> <img src="images/thumbs/15.jpg"/> <div> <h3>Elastislide - A Responsive jQuery Carousel Plugin</h3> With the responsive awakening in web design it becomes important to not only take care of the visual part of a website but also of the functionality. Elastislide is a responsive jQuery carousel that will adapt its size and its behavior in order to work on any screen size. Inserting the carousels structure into a container with a fluid width will also make the carousel fluid. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/09/05/slicebox-3d-image-slider/"> <img src="images/thumbs/14.jpg"/> <div> <h3>Slicebox - A fresh 3D image slider with graceful fallback</h3> With the CSS3 3D transformations we can create some neat effects by transforming elements in three-dimensional space. Slicebox makes use of the 3D transforms properties and allows different kind of effects. The main idea is to create three-dimensional image slices that will rotate and reveal the next image as another side of the 3d object. In case the browser does not support 3D transformations, a simple slider will be used as fallback. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/08/30/automatic-image-montage/"> <img src="images/thumbs/13.jpg"/> <div> <h3>Automatic Image Montage with jQuery</h3> Arranging images in a montage like fashion can be a challenging task when considering certain constraints, like the window size when using fullscreen, the right image number to fill all the available space or also the size of the images in use. With the following script you can automatically create a montage, either for a liquid container or a fixed size container (including fullscreen), with the option to fill all the gaps. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/08/23/image-zoom-tour/"> <img src="images/thumbs/12.jpg"/> <div> <h3>Image Zoom Tour with jQuery</h3> Today we want to share a little zoom tour script with you. Showing a main image initially, we want to be able to zoom into certain parts of the image by clicking on tags, using another image for the closer view. This next step can contain other tags that again allow to show more images. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/08/16/circular-content-carousel/"> <img src="images/thumbs/11.jpg"/> <div> <h3>Circular Content Carousel with jQuery</h3> Today we want to share a simple circular content carousel with you. The idea is to have some content boxes that we can slide infinitely (circular). When clicking on the more link, the respective item moves to the left and a content area will slide out. Now we can navigate through the carousel where each step will reveal the next or previous content box with its expanded content. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/08/09/portfolio-image-navigation/"> <img src="images/thumbs/10.jpg"/> <div> <h3>Portfolio Image Navigation with jQuery</h3> Today we want to create a portfolio image navigation template with jQuery. The idea is to show some portfolio items in a grouped fashion and navigate through them in all 2D ways (horizontal/vertical). Either the arrows or the little boxes below the current image can be used in order to navigate. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/08/04/fullscreen-grid-portfolio/"> <img src="images/thumbs/9.jpg"/> <div> <h3>Expanding Fullscreen Grid Portfolio</h3> Today we want to share a neat experimental portfolio template with you. The main idea is to have a grid layout that we create with jQuery Masonry. Clicking to view more, we expand the according item to fullscreen in order to show a longer description of the item and a representative fullscreen background image. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/07/29/content-rotator/"> <img src="images/thumbs/8.jpg"/> <div> <h3>Content Rotator with jQuery</h3> Today we want to share a fancy content rotator with you. It shows some image with a headline and sub-headline in each slide and allows navigating through the slides using the thumbnails that also contain a headline. Hiding the thumbnails will reveal a scrollable text container and the navigation arrows will move up so that one can navigate to the previous or next slides. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/07/22/vertical-sliding-accordion/"> <img src="images/thumbs/7.jpg"/> <div> <h3>Vertical Sliding Accordion with jQuery</h3> Today we want to share a slick and flexible vertical jQuery accordion with you. The main idea is to expand the accordion slices on click and show some more information. The other slices will become less opaque and squeezed. When navigating to the next slice using one navigation arrows, a new slice will slide in from the top or the bottom. Once a slice is open and we navigate, the subsequent slice will open on slide. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/07/12/animated-text-and-icon-menu/"> <img src="images/thumbs/6.jpg"/> <div> <h3>Animated Text and Icon Menu with jQuery</h3> Today we want to show you how to create a slick menu with a nice animation feature on hover. The idea is to make some elements slide out, change and animate the background color of the item and then slide the elements back in with a different color. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/07/05/fullscreen-slideshow-with-html5-audio/"> <img src="images/thumbs/5.jpg"/> <div> <h3>Fullscreen Slideshow with HTML5 Audio and jQuery</h3> In today's tutorial we'll create a fullscreen photo slideshow to illustrate a New York picture series. We will add sounds with the HTML5 audio element in order to give life to the gallery and try to recreate the ambient of this vibrant city. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/07/03/sliding-background-image-menu/"> <img src="images/thumbs/4.jpg"/> <div> <h3>Sliding Background Image Menu with jQuery</h3> Today we want to share another jQuery menu with you. This menu will have several panels, each one corresponding to a different background image that will show on all panels when we hover over a panel label. Also, a submenu will slide out from the bottom. This menu comes with some configuration possibilities, such as the size of the image, the hover effect and custom default states. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/06/09/grid-navigation-effects/"> <img src="images/thumbs/3.jpg"/> <div> <h3>Grid Navigation Effects with jQuery</h3> Today we want to share some neat grid navigation effects using jQuery. In our examples we will show you ten ways how to navigate through a set of thumbnails. We'll take a look at some of the possibilities and how to apply the effect. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/05/25/image-wall/"> <img src="images/thumbs/2.jpg"/> <div> <h3>Image Wall with jQuery</h3> Today we want to show you how to create a neat image wall with jQuery. The idea is to scatter some thumbnails with different sizes on the page and make a ribbon slide in when we click on the picture. The ribbon will show some description next to the picture and when clicking again on the thumbnail, the ribbon will close and open again with a large version of the image. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/05/09/sliding-letters-with-jquery/"> <img src="images/thumbs/1.jpg"/> <div> <h3>Sliding Letters with jQuery</h3> Today we have a neat little effect for you. We want to bring some life to the standard hover effect by playing around with the letters in an anchor word. The aim is to slide in letter by letter when hovering over a link element. We can either have the same word or a different one and we can slide in the new letters all the same time or one after the other. </div> </a> </div>он у Вас уже вставлен, просто проверьте лишний раз.
У Вас в файле main.js есть код -
$(document).ready(function(){ $('#jp-container').jscrollpane({ display: 2 }); // Кнопки на сайте если подгружен модуль Jquery.UI if(typeof($('input:submit, input.button').button) == "function" ) { $('input:submit, input.button').button(); }не совсем понятно для чего он нужен. При этом выскакивает ошибка.
#305
Отправлено 03 Ноябрь 2013 - 08:33
miyako (03 Ноябрь 2013 - 06:57) писал:
Допустим первый.
Скрипт нужно вставить в конец файла main.js -
$(function() { // the element we want to apply the jScrollPane var $el = $('#jp-container').jScrollPane({ verticalGutter : -16 }), // the extension functions and options extensionPlugin = { extPluginOpts : { // speed for the fadeOut animation mouseLeaveFadeSpeed : 500, // scrollbar fades out after hovertimeout_t milliseconds hovertimeout_t : 1000, // if set to false, the scrollbar will be shown on mouseenter and hidden on mouseleave // if set to true, the same will happen, but the scrollbar will be also hidden on mouseenter after "hovertimeout_t" ms // also, it will be shown when we start to scroll and hidden when stopping useTimeout : true, // the extension only applies for devices with width > deviceWidth deviceWidth : 980 }, hovertimeout : null, // timeout to hide the scrollbar isScrollbarHover: false,// true if the mouse is over the scrollbar elementtimeout : null, // avoids showing the scrollbar when moving from inside the element to outside, passing over the scrollbar isScrolling : false,// true if scrolling addHoverFunc : function() { // run only if the window has a width bigger than deviceWidth if( $(window).width() <= this.extPluginOpts.deviceWidth ) return false; var instance = this; // functions to show / hide the scrollbar $.fn.jspmouseenter = $.fn.show; $.fn.jspmouseleave = $.fn.fadeOut; // hide the jScrollPane vertical bar var $vBar = this.getContentPane().siblings('.jspVerticalBar').hide(); /* * mouseenter / mouseleave events on the main element * also scrollstart / scrollstop - @James Padolsey : http://james.padolsey.com/javascript/special-scroll-events-for-jquery/ */ $el.bind('mouseenter.jsp',function() { // show the scrollbar $vBar.stop( true, true ).jspmouseenter(); if( !instance.extPluginOpts.useTimeout ) return false; // hide the scrollbar after hovertimeout_t ms clearTimeout( instance.hovertimeout ); instance.hovertimeout = setTimeout(function() { // if scrolling at the moment don't hide it if( !instance.isScrolling ) $vBar.stop( true, true ).jspmouseleave( instance.extPluginOpts.mouseLeaveFadeSpeed || 0 ); }, instance.extPluginOpts.hovertimeout_t ); }).bind('mouseleave.jsp',function() { // hide the scrollbar if( !instance.extPluginOpts.useTimeout ) $vBar.stop( true, true ).jspmouseleave( instance.extPluginOpts.mouseLeaveFadeSpeed || 0 ); else { clearTimeout( instance.elementtimeout ); if( !instance.isScrolling ) $vBar.stop( true, true ).jspmouseleave( instance.extPluginOpts.mouseLeaveFadeSpeed || 0 ); } }); if( this.extPluginOpts.useTimeout ) { $el.bind('scrollstart.jsp', function() { // when scrolling show the scrollbar clearTimeout( instance.hovertimeout ); instance.isScrolling = true; $vBar.stop( true, true ).jspmouseenter(); }).bind('scrollstop.jsp', function() { // when stop scrolling hide the scrollbar (if not hovering it at the moment) clearTimeout( instance.hovertimeout ); instance.isScrolling = false; instance.hovertimeout = setTimeout(function() { if( !instance.isScrollbarHover ) $vBar.stop( true, true ).jspmouseleave( instance.extPluginOpts.mouseLeaveFadeSpeed || 0 ); }, instance.extPluginOpts.hovertimeout_t ); }); // wrap the scrollbar // we need this to be able to add the mouseenter / mouseleave events to the scrollbar var $vBarWrapper = $('<div/>').css({ position : 'absolute', left : $vBar.css('left'), top : $vBar.css('top'), right : $vBar.css('right'), bottom : $vBar.css('bottom'), width : $vBar.width(), height : $vBar.height() }).bind('mouseenter.jsp',function() { clearTimeout( instance.hovertimeout ); clearTimeout( instance.elementtimeout ); instance.isScrollbarHover = true; // show the scrollbar after 100 ms. // avoids showing the scrollbar when moving from inside the element to outside, passing over the scrollbar instance.elementtimeout = setTimeout(function() { $vBar.stop( true, true ).jspmouseenter(); }, 100 ); }).bind('mouseleave.jsp',function() { // hide the scrollbar after hovertimeout_t clearTimeout( instance.hovertimeout ); instance.isScrollbarHover = false; instance.hovertimeout = setTimeout(function() { // if scrolling at the moment don't hide it if( !instance.isScrolling ) $vBar.stop( true, true ).jspmouseleave( instance.extPluginOpts.mouseLeaveFadeSpeed || 0 ); }, instance.extPluginOpts.hovertimeout_t ); }); $vBar.wrap( $vBarWrapper ); } } }, // the jScrollPane instance jspapi = $el.data('jsp'); // extend the jScollPane by merging $.extend( true, jspapi, extensionPlugin ); jspapi.addHoverFunc(); });
код карусели -
<div id="jp-container" class="jp-container"> <a target="_blank" href="http://tympanus.net/codrops/2011/09/20/responsive-image-gallery/"> <img src="images/thumbs/16.jpg"/> <div> <h3>Responsive Image Gallery with Thumbnail Carousel</h3> A tutorial on how to create a responsive image gallery with a thumbnail carousel using Elastislide. Inspired by Twitter's "user gallery" and upon a request to show an integration of Elastislide, we want to implement a responsive gallery that adapts to the view-port width. The gallery will have a view switch that allows to view it with the thumbnail carousel or without. We'll also add the possibility to navigate with the keyboard. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/09/12/elastislide-responsive-carousel/"> <img src="images/thumbs/15.jpg"/> <div> <h3>Elastislide - A Responsive jQuery Carousel Plugin</h3> With the responsive awakening in web design it becomes important to not only take care of the visual part of a website but also of the functionality. Elastislide is a responsive jQuery carousel that will adapt its size and its behavior in order to work on any screen size. Inserting the carousels structure into a container with a fluid width will also make the carousel fluid. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/09/05/slicebox-3d-image-slider/"> <img src="images/thumbs/14.jpg"/> <div> <h3>Slicebox - A fresh 3D image slider with graceful fallback</h3> With the CSS3 3D transformations we can create some neat effects by transforming elements in three-dimensional space. Slicebox makes use of the 3D transforms properties and allows different kind of effects. The main idea is to create three-dimensional image slices that will rotate and reveal the next image as another side of the 3d object. In case the browser does not support 3D transformations, a simple slider will be used as fallback. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/08/30/automatic-image-montage/"> <img src="images/thumbs/13.jpg"/> <div> <h3>Automatic Image Montage with jQuery</h3> Arranging images in a montage like fashion can be a challenging task when considering certain constraints, like the window size when using fullscreen, the right image number to fill all the available space or also the size of the images in use. With the following script you can automatically create a montage, either for a liquid container or a fixed size container (including fullscreen), with the option to fill all the gaps. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/08/23/image-zoom-tour/"> <img src="images/thumbs/12.jpg"/> <div> <h3>Image Zoom Tour with jQuery</h3> Today we want to share a little zoom tour script with you. Showing a main image initially, we want to be able to zoom into certain parts of the image by clicking on tags, using another image for the closer view. This next step can contain other tags that again allow to show more images. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/08/16/circular-content-carousel/"> <img src="images/thumbs/11.jpg"/> <div> <h3>Circular Content Carousel with jQuery</h3> Today we want to share a simple circular content carousel with you. The idea is to have some content boxes that we can slide infinitely (circular). When clicking on the more link, the respective item moves to the left and a content area will slide out. Now we can navigate through the carousel where each step will reveal the next or previous content box with its expanded content. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/08/09/portfolio-image-navigation/"> <img src="images/thumbs/10.jpg"/> <div> <h3>Portfolio Image Navigation with jQuery</h3> Today we want to create a portfolio image navigation template with jQuery. The idea is to show some portfolio items in a grouped fashion and navigate through them in all 2D ways (horizontal/vertical). Either the arrows or the little boxes below the current image can be used in order to navigate. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/08/04/fullscreen-grid-portfolio/"> <img src="images/thumbs/9.jpg"/> <div> <h3>Expanding Fullscreen Grid Portfolio</h3> Today we want to share a neat experimental portfolio template with you. The main idea is to have a grid layout that we create with jQuery Masonry. Clicking to view more, we expand the according item to fullscreen in order to show a longer description of the item and a representative fullscreen background image. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/07/29/content-rotator/"> <img src="images/thumbs/8.jpg"/> <div> <h3>Content Rotator with jQuery</h3> Today we want to share a fancy content rotator with you. It shows some image with a headline and sub-headline in each slide and allows navigating through the slides using the thumbnails that also contain a headline. Hiding the thumbnails will reveal a scrollable text container and the navigation arrows will move up so that one can navigate to the previous or next slides. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/07/22/vertical-sliding-accordion/"> <img src="images/thumbs/7.jpg"/> <div> <h3>Vertical Sliding Accordion with jQuery</h3> Today we want to share a slick and flexible vertical jQuery accordion with you. The main idea is to expand the accordion slices on click and show some more information. The other slices will become less opaque and squeezed. When navigating to the next slice using one navigation arrows, a new slice will slide in from the top or the bottom. Once a slice is open and we navigate, the subsequent slice will open on slide. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/07/12/animated-text-and-icon-menu/"> <img src="images/thumbs/6.jpg"/> <div> <h3>Animated Text and Icon Menu with jQuery</h3> Today we want to show you how to create a slick menu with a nice animation feature on hover. The idea is to make some elements slide out, change and animate the background color of the item and then slide the elements back in with a different color. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/07/05/fullscreen-slideshow-with-html5-audio/"> <img src="images/thumbs/5.jpg"/> <div> <h3>Fullscreen Slideshow with HTML5 Audio and jQuery</h3> In today's tutorial we'll create a fullscreen photo slideshow to illustrate a New York picture series. We will add sounds with the HTML5 audio element in order to give life to the gallery and try to recreate the ambient of this vibrant city. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/07/03/sliding-background-image-menu/"> <img src="images/thumbs/4.jpg"/> <div> <h3>Sliding Background Image Menu with jQuery</h3> Today we want to share another jQuery menu with you. This menu will have several panels, each one corresponding to a different background image that will show on all panels when we hover over a panel label. Also, a submenu will slide out from the bottom. This menu comes with some configuration possibilities, such as the size of the image, the hover effect and custom default states. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/06/09/grid-navigation-effects/"> <img src="images/thumbs/3.jpg"/> <div> <h3>Grid Navigation Effects with jQuery</h3> Today we want to share some neat grid navigation effects using jQuery. In our examples we will show you ten ways how to navigate through a set of thumbnails. We'll take a look at some of the possibilities and how to apply the effect. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/05/25/image-wall/"> <img src="images/thumbs/2.jpg"/> <div> <h3>Image Wall with jQuery</h3> Today we want to show you how to create a neat image wall with jQuery. The idea is to scatter some thumbnails with different sizes on the page and make a ribbon slide in when we click on the picture. The ribbon will show some description next to the picture and when clicking again on the thumbnail, the ribbon will close and open again with a large version of the image. </div> </a> <a target="_blank" href="http://tympanus.net/codrops/2011/05/09/sliding-letters-with-jquery/"> <img src="images/thumbs/1.jpg"/> <div> <h3>Sliding Letters with jQuery</h3> Today we have a neat little effect for you. We want to bring some life to the standard hover effect by playing around with the letters in an anchor word. The aim is to slide in letter by letter when hovering over a link element. We can either have the same word or a different one and we can slide in the new letters all the same time or one after the other. </div> </a> </div>он у Вас уже вставлен, просто проверьте лишний раз.
У Вас в файле main.js есть код -
$(document).ready(function(){ $('#jp-container').jscrollpane({ display: 2 }); // Кнопки на сайте если подгружен модуль Jquery.UI if(typeof($('input:submit, input.button').button) == "function" ) { $('input:submit, input.button').button(); }не совсем понятно для чего он нужен. При этом выскакивает ошибка.
Огромное Вам спасибо за помощь, все сделала и получилось!
Единственный вопрос: можно ли серую кнопку, которая прокручивает карусель перекрасить в другой цвет? А то выбивается из стиля.
#306
Отправлено 03 Ноябрь 2013 - 08:55
#307
Отправлено 03 Ноябрь 2013 - 10:38
ginger (03 Ноябрь 2013 - 08:55) писал:
Найдите код в файле - jquery.jscrollpane.codrops1.css
.jspDrag { background: #79a1b5; position: relative; top: 0; left: 0; cursor: pointer; border: 1px solid #56839a; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }и измените код цвета #79a1b5, а также #56839a (рамка)
#308
Отправлено 03 Ноябрь 2013 - 11:43
miyako (03 Ноябрь 2013 - 10:38) писал:
.jspDrag { background: #79a1b5; position: relative; top: 0; left: 0; cursor: pointer; border: 1px solid #56839a; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }и измените код цвета #79a1b5, а также #56839a (рамка)
Спасибо!!!
#309
Отправлено 06 Ноябрь 2013 - 13:14
#310
Отправлено 06 Ноябрь 2013 - 15:02
<script type="text/javascript" src="http://cdn.abtest.ru/js/23351.js"></script>
#312
Отправлено 07 Ноябрь 2013 - 02:06
id="slider-code"
и замените её на
id="slider1"
после в файл main.js добавьте
$(function() { $('#slider1').tinycarousel({ display: 2 }); });
#313
Отправлено 14 Ноябрь 2013 - 16:26
#314
Отправлено 14 Ноябрь 2013 - 19:44
Dmitriy73 (14 Ноябрь 2013 - 16:26) писал:
#315
Отправлено 19 Январь 2014 - 14:04
В описание вместо новостей поставить кнопку купить и цену.
Koderhan (27 Ноябрь 2012 - 16:34) писал:
Если хотите это исправить то можете добавить код в файл main.csstemplate (Сайт-> Редактор тем).
#content {width: 960px;margin: 0 auto;}Теперь приступим к установке карусели.
Почти все действия нужно производить в панели администратора. Сайт -> Редактор тем.
Загрузить и распаковать архив себе на компьютер.
horizantal-carousel-news.zip
Содержимое архива нужно загрузить на сайт.
ScreenShot 152.jpg
Теперь подключим загруженные css и js файлы к сайту.
Открыть файл HTML.
После кода:
<!-- Скрипты магазина --> <script type="text/javascript" src="{ASSETS_JS_PATH}main.js"></script>Добавить:
<script type="text/javascript" src="{ASSETS_JS_PATH}jquery.jcarousel.js"></script> <link rel="stylesheet" href="{ASSETS_STYLES_PATH}carousel.css" type="text/css" />
В этом же файле. До кода:
{BODY}Добавить:
{% IF index_page %} <script type="text/javascript"> jQuery(document).ready(function() { // Initialise the first and second carousel by class selector. // Note that they use both the same configuration options (none in this case). jQuery('.d-carousel .carousel').jcarousel({ scroll: 1 }); }); </script> <!-- Begin Wrapper --> <div id="wrapper"> <div class="d-carousel"> <ul class="carousel"> {% FOR index_page_new_goods %} <li> <a href="#"><img src="{% IF index_page_new_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png{% ELSE %}{index_page_new_goods.IMAGE_SMALL}{% ENDIF %}" alt="{index_page_new_goods.NAME}" /></a> <h4><a href="{index_page_new_goods.URL}">{index_page_new_goods.NAME}</a></h4> <p>{index_page_new_goods.DESCRIPTION_SHORT}</p> </li> {% ENDFOR index_page_new_goods %} </ul> </div> <div class="clear"></div> </div> <!-- End Wrapper --> {% ENDIF %}ScreenShot 153.jpg
В этой карусели будут выводиться товары из категории "Новинки" только на главной странице.
#316
Отправлено 21 Январь 2014 - 04:29
<div id="wrapper"> <div class="d-carousel"> <ul class="carousel"> {% FOR index_page_new_goods %} <li> <a href="#"><img src="{% IF index_page_new_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png{% ELSE %}{index_page_new_goods.IMAGE_SMALL}{% ENDIF %}" alt="{index_page_new_goods.NAME}" /></a> <h4><a href="{index_page_new_goods.URL}">{index_page_new_goods.NAME}</a></h4> <p>{index_page_new_goods.DESCRIPTION_SHORT}</p> </li> {% ENDFOR index_page_new_goods %} </ul> </div> <div class="clear"></div> </div>
вставляем:
{% IFNOT index_page_new_goods_empty %} <div class="hr"></div> <div class="box padd"> <div class="titlebox fnt11b txtalgnlft"> <ul> <li class="blue fnt11b"> <h2><a href="{CATALOG_NEW_URL}">Новинки</a></h2> </li> </ul> </div> <div id="wrapper"> <div class="d-carousel"> <ul class="carousel"> {% FOR index_page_new_goods %} <li> <div class="tabproduct"> <div class="title fnt12b txtalgncnt"> <a href="{index_page_new_goods.URL}" title="Перейти на страницу «{index_page_new_goods.NAME}»">{index_page_new_goods.NAME}</a> </div> <div class="img txtalgncnt"> <a href="{index_page_new_goods.URL}" title="Перейти на страницу «{index_page_new_goods.NAME}»"><img src="{% IF index_page_new_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-other.png{% ELSE %}{index_page_new_goods.IMAGE_OTHER}{% ENDIF %}" alt="{index_page_new_goods.NAME}" /></a> </div> <div class="price fnt12b txtalgncnt"> Цена: {% IF index_page_new_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>index_page_new_goods.MIN_PRICE_NOW %} <span>{index_page_new_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT | number_format("0", ",", " ")}</span> {% ELSEIF index_page_new_goods.MIN_PRICE_OLD>index_page_new_goods.MIN_PRICE_NOW %} <span>{index_page_new_goods.MIN_PRICE_OLD | number_format("0", ",", " ")}</span> {% ENDIF %} <em class="fnt12b">{index_page_new_goods.MIN_PRICE_NOW | money_format}</em> </div> <div class="buttons txtalgncnt"> {% IF index_page_new_goods.MAX_REST_VALUE>0 %}<a href="{index_page_new_goods.URL}" class="whtgreen" title="Перейти на страницу «{index_page_new_goods.NAME}»">Подробнее</a> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="goodsListForm"> <div> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{index_page_new_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{index_page_new_goods.MIN_PRICE_NOW_ID}" /> <button type="submit"class="blgreen">Купить</button> </div> </form> {% ENDIF %} {% IF index_page_new_goods.MAX_REST_VALUE=0 %} <a href="{index_page_new_goods.URL}" class="whtgreen" style="margin:0 0 0 70px;" title="Перейти на страницу «{index_page_new_goods.NAME}»">Подробнее</a> {% ENDIF %} </div> </div> </li> {% ENDFOR index_page_new_goods %} </ul> </div> <div class="clear"></div> </div> </div> {% ENDIF %}
#317
Отправлено 21 Январь 2014 - 06:54
Vaccina (21 Январь 2014 - 04:29) писал:
<div id="wrapper"> <div class="d-carousel"> <ul class="carousel"> {% FOR index_page_new_goods %} <li> <a href="#"><img src="{% IF index_page_new_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png{% ELSE %}{index_page_new_goods.IMAGE_SMALL}{% ENDIF %}" alt="{index_page_new_goods.NAME}" /></a> <h4><a href="{index_page_new_goods.URL}">{index_page_new_goods.NAME}</a></h4> <p>{index_page_new_goods.DESCRIPTION_SHORT}</p> </li> {% ENDFOR index_page_new_goods %} </ul> </div> <div class="clear"></div> </div>
вставляем:
{% IFNOT index_page_new_goods_empty %} <div class="hr"></div> <div class="box padd"> <div class="titlebox fnt11b txtalgnlft"> <ul> <li class="blue fnt11b"> <h2><a href="{CATALOG_NEW_URL}">Новинки</a></h2> </li> </ul> </div> <div id="wrapper"> <div class="d-carousel"> <ul class="carousel"> {% FOR index_page_new_goods %} <li> <div class="tabproduct"> <div class="title fnt12b txtalgncnt"> <a href="{index_page_new_goods.URL}" title="Перейти на страницу «{index_page_new_goods.NAME}»">{index_page_new_goods.NAME}</a> </div> <div class="img txtalgncnt"> <a href="{index_page_new_goods.URL}" title="Перейти на страницу «{index_page_new_goods.NAME}»"><img src="{% IF index_page_new_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-other.png{% ELSE %}{index_page_new_goods.IMAGE_OTHER}{% ENDIF %}" alt="{index_page_new_goods.NAME}" /></a> </div> <div class="price fnt12b txtalgncnt"> Цена: {% IF index_page_new_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>index_page_new_goods.MIN_PRICE_NOW %} <span>{index_page_new_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT | number_format("0", ",", " ")}</span> {% ELSEIF index_page_new_goods.MIN_PRICE_OLD>index_page_new_goods.MIN_PRICE_NOW %} <span>{index_page_new_goods.MIN_PRICE_OLD | number_format("0", ",", " ")}</span> {% ENDIF %} <em class="fnt12b">{index_page_new_goods.MIN_PRICE_NOW | money_format}</em> </div> <div class="buttons txtalgncnt"> {% IF index_page_new_goods.MAX_REST_VALUE>0 %}<a href="{index_page_new_goods.URL}" class="whtgreen" title="Перейти на страницу «{index_page_new_goods.NAME}»">Подробнее</a> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="goodsListForm"> <div> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{index_page_new_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{index_page_new_goods.MIN_PRICE_NOW_ID}" /> <button type="submit"class="blgreen">Купить</button> </div> </form> {% ENDIF %} {% IF index_page_new_goods.MAX_REST_VALUE=0 %} <a href="{index_page_new_goods.URL}" class="whtgreen" style="margin:0 0 0 70px;" title="Перейти на страницу «{index_page_new_goods.NAME}»">Подробнее</a> {% ENDIF %} </div> </div> </li> {% ENDFOR index_page_new_goods %} </ul> </div> <div class="clear"></div> </div> </div> {% ENDIF %}
Если требуется настроенный ccs на отображение 3 колонок то пользуйтесь
/*-----------------------------------------------------------------------------------*/ /* 0. RESET /*-----------------------------------------------------------------------------------*/ .d-carousel ol, ul { list-style:none } .d-carousel blockquote, q { quotes:none } .d-carousel blockquote:before, blockquote:after, q:before, q:after { content:''; content:none } :focus { outline:0 } .d-carousel ins { text-decoration:none } .d-carousel del { text-decoration:line-through } .d-carousel table { border-collapse:collapse; border-spacing:0 } .d-carousel .clear { clear:both; display:block; overflow:hidden; visibility:hidden; width:0; height:0 } .d-carousel .clearfix:after { clear:both; content:' '; display:block; font-size:0; line-height:0; visibility:hidden; width:0; height:0 } .d-carousel .clearfix { display:inline-block } * html .clearfix { height:1% } .d-carousel .clearfix { display:block } /*-----------------------------------------------------------------------------------*/ /* 1. FONT-FACE /*-----------------------------------------------------------------------------------*/ @font-face { font-family: 'Puritan20Italic'; src: url('style/type/puritan/puritan_italic-webfont.eot?') format('eot'), url('style/type/puritan/puritan_italic-webfont.woff') format('woff'), url('style/type/puritan/puritan_italic-webfont.ttf') format('truetype'), url('style/type/puritan/puritan_italic-webfont.svg#webfontZMWmRIPG') format('svg'); font-weight: normal; font-style: normal; } @font-face { font-family: 'Puritan20Normal'; src: url('style/type/puritan/puritan_regular-webfont.eot?') format('eot'), url('style/type/puritan/puritan_regular-webfont.woff') format('woff'), url('style/type/puritan/puritan_regular-webfont.ttf') format('truetype'), url('style/type/puritan/puritan_regular-webfont.svg#webfontJ25dHiGv') format('svg'); font-weight: normal; font-style: normal; } /*-----------------------------------------------------------------------------------*/ /* 2. GENERAL /*-----------------------------------------------------------------------------------*/ .d-carousel a { text-decoration: none; color: #4b4b4b; } .d-carousel a:hover { text-decoration: none; color: #1c1c1c; } .d-carousel h1, h2, h3, h4, h5, h6 { font-family: 'Puritan20Normal'; font-weight: normal; color: #4b4b4b; margin-bottom: 10px; } .d-carousel h4 { font-size: 16px; line-height: 20px; padding-bottom: 7px; } /*-----------------------------------------------------------------------------------*/ /* 3. CAROUSEL /*-----------------------------------------------------------------------------------*/ #wrapper .d-carousel ul li { background: none; padding: 1px; width: 235px; } .jcarousel-direction-rtl { direction: rtl; } .d-carousel h4 { margin: 5px 0 5px 0; font-size: 14px; } .d-carousel .jcarousel-container { display: block; overflow: hidden; margin-bottom: 10px; } .d-carousel .jcarousel-item { width: 190px; height: 290px; } .d-carousel .jcarousel-container-horizontal { width: 735px; height: 265px; padding: 1px; } .d-carousel .jcarousel-item-horizontal { margin-left: 3px; margin-bottom: 3px; margin-top: 3px; margin-right: 5px; } .d-carousel .jcarousel-next-horizontal { position: absolute; top: 115px; right: 0; margin-right: 3px; width: 15px; height: 28px; cursor: pointer; background: transparent url({ASSETS_IMAGES_PATH}blog-arrows.jpg) no-repeat top right; } .d-carousel .jcarousel-direction-rtl .jcarousel-next-horizontal { left: 5px; right: auto; background-image: url({ASSETS_IMAGES_PATH}blog-arrows.jpg); } .d-carousel .jcarousel-next-horizontal:hover { background-position: bottom right; } .d-carousel .jcarousel-prev-horizontal { position: absolute; top: 115px; left: 0; margin-left: 3px; width: 15px; height: 28px; cursor: pointer; background: transparent url({ASSETS_IMAGES_PATH}blog-arrows.jpg) no-repeat top left; } .d-carousel .jcarousel-direction-rtl .jcarousel-prev-horizontal { left: auto; right: 5px; background-image: url({ASSETS_IMAGES_PATH}blog-arrows.jpg); } .d-carousel .jcarousel-prev-horizontal:hover { background-position: bottom left; }
#318
Отправлено 27 Январь 2014 - 11:08
#319
Отправлено 27 Январь 2014 - 11:29
poznanskii (27 Январь 2014 - 11:08) писал:
У Вас не загружены файлы carousel.css, jquery.jcarousel.js
#320
Отправлено 27 Январь 2014 - 11:38
miyako (27 Январь 2014 - 11:29) писал:
Я вообще изначально хотел передвинуть блог "Новинки" наверх и сделать из них карусель! Это вообще возможно?
Количество пользователей, читающих эту тему: 0
0 пользователей, 0 гостей, 0 анонимных