jQuery woothemes FlexSlider - 슬라이더

Open API/Jquery|2016. 11. 17. 11:11
반응형



플러그인 형태로 쉽게 이용할 수 있는 슬라이더 입니다.



Plugin Url : http://source.woothemes.com/flexslider/


download : woothemes-FlexSlider-version-2.2.2-0-gce5441b.zip


License : MIT License




사용 샘플 코드 


Step 1.

<!-- Place somewhere in the <head> of your document -->
<link rel="stylesheet" href="flexslider.css" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="jquery.flexslider.js"></script>

Step 2.

<!-- Place somewhere in the <body> of your page -->
<div class="flexslider">
  <ul class="slides">
    <li>
      <img src="slide1.jpg" />
    </li>
    <li>
      <img src="slide2.jpg" />
    </li>
    <li>
      <img src="slide3.jpg" />
    </li>
  </ul>
</div>



Step 3.

<!-- Place in the <head>, after the three links -->
<script type="text/javascript" charset="utf-8">
  $(window).load(function() {
    $('.flexslider').flexslider();
  });
</script>



Step 3.


옵션 : 상세 설명 https://github.com/woothemes/FlexSlider/wiki/FlexSlider-Properties

namespace: "flex-",             //{NEW} String: Prefix string attached to the class of every element generated by the plugin
selector: ".slides > li",       //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
animation: "fade",              //String: Select your animation type, "fade" or "slide"
easing: "swing",               //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
direction: "horizontal",        //String: Select the sliding direction, "horizontal" or "vertical"
reverse: false,                 //{NEW} Boolean: Reverse the animation direction
animationLoop: true,             //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
smoothHeight: false,            //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode  
startAt: 0,                     //Integer: The slide that the slider should start on. Array notation (0 = first slide)
slideshow: true,                //Boolean: Animate slider automatically
slideshowSpeed: 7000,           //Integer: Set the speed of the slideshow cycling, in milliseconds
animationSpeed: 600,            //Integer: Set the speed of animations, in milliseconds
initDelay: 0,                   //{NEW} Integer: Set an initialization delay, in milliseconds
randomize: false,               //Boolean: Randomize slide order
  
// Usability features
pauseOnAction: true,            //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
pauseOnHover: false,            //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
useCSS: true,                   //{NEW} Boolean: Slider will use CSS3 transitions if available
touch: true,                    //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices
video: false,                   //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches
  
// Primary Controls
controlNav: true,               //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
directionNav: true,             //Boolean: Create navigation for previous/next navigation? (true/false)
prevText: "Previous",           //String: Set the text for the "previous" directionNav item
nextText: "Next",               //String: Set the text for the "next" directionNav item
  
// Secondary Navigation
keyboard: true,                 //Boolean: Allow slider navigating via keyboard left/right keys
multipleKeyboard: false,        //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present.
mousewheel: false,              //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel
pausePlay: false,               //Boolean: Create pause/play dynamic element
pauseText: 'Pause',             //String: Set the text for the "pause" pausePlay item
playText: 'Play',               //String: Set the text for the "play" pausePlay item
  
// Special properties
controlsContainer: "",          //{UPDATED} Selector: USE CLASS SELECTOR. Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be ".flexslider-container". Property is ignored if given element is not found.
manualControls: "",             //Selector: Declare custom control navigation. Examples would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
sync: "",                       //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care.
asNavFor: "",                   //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider
  
// Carousel Options
itemWidth: 0,                   //{NEW} Integer: Box-model width of individual carousel items, including horizontal borders and padding.
itemMargin: 0,                  //{NEW} Integer: Margin between carousel items.
minItems: 0,                    //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this.
maxItems: 0,                    //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit.
move: 0,                        //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items.
                                 
// Callback API
start: function(){},            //Callback: function(slider) - Fires when the slider loads the first slide
before: function(){},           //Callback: function(slider) - Fires asynchronously with each slider animation
after: function(){},            //Callback: function(slider) - Fires after each slider animation completes
end: function(){},              //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
added: function(){},            //{NEW} Callback: function(slider) - Fires after a slide is added
removed: function(){}           //{NEW} Callback: function(slider) - Fires after a slide is removed


댓글()

jQuery Moodular - 이미지 회전,슬라이더, 터치 ,모자이크

Open API/Jquery|2016. 11. 10. 09:27
반응형



site : http://www.gougouzian.fr/


Front & Back -end Developer

Plugin & method Url : http://www.gougouzian.fr/projects/jquery/moodular/


Test Url : http://www.uhoon.co.kr/test/885.html


license : MIT License / GPL - GNU General Public License 



이미지 슬라이드 , 회전 , 터치도 지원한다고 합니다. 


대형 배너나 이미지슬라이드등에 용이할것같습니다.


easing을 이용해서 다양한 effect를 지원하는 등..옵션이 상당히 많습니다.



<!doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <title>moodular </title>
</head>
<style type="text/css"> 
/* moodular */
#moodular { overflow: hidden }
    #moodular, #moodular li { margin: 0; padding: 0; list-style: none; width: 900px; }
/* examples */
    #moodular, #moodular li { height: 400px; }
        #moodular li p { display: block; height: 400px; }
            #moodular li p span { display: inline-block; padding: 10px 10px; color: #FFF; margin: 10px; }
#nav_wrapper { margin: 0; padding: 0; list-style: none; width: 80px; height: 20px; overflow: hidden }
    #nav_wrapper li { text-align: center; }
        #nav_wrapper li.active { color: #FFF; }
  
</style>  
<body>
 
<ul id="moodular">
    <li><p style="background-image: url(http://www.gougouzian.fr/projects/jquery/moodular/assets/img/photo01.jpg);"><span>가나다라</span></p></li>
    <li><p style="background-image: url(http://www.gougouzian.fr/projects/jquery/moodular/assets/img/photo02.jpg);"><span>마바사아</span></p></li>
    <li><p style="background-image: url(http://www.gougouzian.fr/projects/jquery/moodular/assets/img/photo03.jpg);"><span>자차카</span></p></li>
    <li><p style="background-image: url(http://www.gougouzian.fr/projects/jquery/moodular/assets/img/photo04.jpg);"><span>타파하</span></p></li>
    <li><p style="background-image: url(http://www.gougouzian.fr/projects/jquery/moodular/assets/img/photo05.jpg);"><span>www.goodkiss.co.kr</span></p></li>
    <li><p style="background-image: url(http://www.gougouzian.fr/projects/jquery/moodular/assets/img/photo06.jpg);"><span>www.uhoon.co.kr</span></p></li>
</ul>  
<!-- script -->
<script src="http://code.jquery.com/jquery-latest.min.js"></script>  
<script src="885/jquery.easing.1.3.js"></script> 
<script src="885/moodular.js"></script>  
<script>
jQuery(document).ready(function () { 
    var couleurs = ["rgba(219,56,92, 0.6)"  ,
    "rgba(104,197,255, 0.6)",
    "rgba(151,90,193, 0.6)",
    "rgba(193,70,136, 0.6)",
    "rgba(168,123,187, 0.6)",
    "rgba(41,186,116, 0.6)",
    "rgba(148,189,36, 0.6)",
    "rgba(240,61,44, 0.6)",
    "rgba(56,155,217, 0.6)",
    "rgba(32,187,185, 0.6)", 
    "rgba(32,169,255, 0.6)"];
 
    jQuery('#moodular li p span').each(function() {
        jQuery(this).css('background-color', couleurs[Math.floor(Math.random() * couleurs.length)]);
    });
 
    jQuery('#moodular').moodular({
/* core parameters */
    // effects separated by space
    effects: 'mosaic',
    // controls separated by space
    controls: 'keys',
    // if you want some yummy transition
    easing: 'easeOutExpo',
    // step 
    step: 1,
    // selector is to specify the children of your element (tagName)
    selector: 'li',
    // if timer is 0 the carrousel isn't automatic, else it's the interval in ms between each step
    timer: 5000,
    // speed is the time in ms of the transition
    speed: 5000,
    // queuing animation ?
    queue: false,
/* parameters for controls or effects */
    // keys control
    keyPrev: 37, // left key
    keyNext: 39, // right key
    // mosaic effects
    slices: [10, 4],
    mode : 'random'//,
    // others
    //your_params : 'cause you can create your own effect or control'
  }); 
});
</script>
</body>
</html>

댓글()