ابوالفضل حیدری
1 سال پیش توسط ابوالفضل حیدری مطرح شد
1 پاسخ

استفاده از JQuery

من یه فایل jquery دارم و نمیدونم باید چی کار کنم که که تو سایت ازش خروجی بگیرم،البته چندین روش رو امتحان کردم ولی جواب نمیده...

( function($) {

    $(document).ready(function() {

      var s           = $('.slider'),
          sWrapper    = s.find('.slider-wrapper'),
          sItem       = s.find('.slide'),
          btn         = s.find('.slider-link'),
          sWidth      = sItem.width(),
          sCount      = sItem.length,
          slide_date  = s.find('.slide-date'),
          slide_title = s.find('.slide-title'),
          slide_text  = s.find('.slide-text'),
          slide_more  = s.find('.slide-more'),
          slide_image = s.find('.slide-image img'),
          sTotalWidth = sCount * sWidth;

      sWrapper.css('width', sTotalWidth);
      sWrapper.css('width', sTotalWidth);

      var clickCount  = 0;

      btn.on('click', function(e) {
        e.preventDefault();

        if( $(this).hasClass('next') ) {

          ( clickCount < ( sCount - 1 ) ) ? clickCount++ : clickCount = 0;
        } else if ( $(this).hasClass('prev') ) {

          ( clickCount > 0 ) ? clickCount-- : ( clickCount = sCount - 1 );
        }
        TweenMax.to(sWrapper, 0.4, {x: '-' + ( sWidth * clickCount ) })

        //CONTENT ANIMATIONS

        var fromProperties = {autoAlpha:0, x:'-50', y:'-10'};
        var toProperties = {autoAlpha:0.8, x:'0', y:'0'};

        TweenLite.fromTo(slide_image, 1, {autoAlpha:0, y:'40'}, {autoAlpha:1, y:'0'});
        TweenLite.fromTo(slide_date, 0.4, fromProperties, toProperties);
        TweenLite.fromTo(slide_title, 0.6, fromProperties, toProperties);
        TweenLite.fromTo(slide_text, 0.8, fromProperties, toProperties);
        TweenLite.fromTo(slide_more, 1, fromProperties, toProperties);

      });

    });
  })(jQuery);

  $('.overlay').addClass('overlay-blue');

ثبت پرسش جدید
ابوالفضل حیدری
@abolfazl-heydari 1 سال پیش مطرح شد
0

منظورم اینه که به سایت وصل هست ولی خروجی که میخوام رو نمیگیرم ولی به نظر م کد درسته، برای ساخت اسلایدر به کار بردم


برای ارسال پاسخ لازم است وارد شده یا ثبت‌نام کنید

ورود یا ثبت‌نام