Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------- jquery condition button if login show button and if loggedout then redirect login page --------------
- jQuery(document).ready(function( $ ){
- if(jQuery('body').hasClass('logged-in'))
- {
- }else{
- jQuery('.btn.show-code').attr('href','/login/');
- }
- });
- ------or-------
- jQuery(document).ready(function( $ ){
- if(jQuery('body').hasClass('logged-in'))
- {
- } else {
- $(".btn.show-code").click(function(){
- window.location.href='https://www.couponmii.com/login';
- });
- }
- });
- ------------ Bootstrap tab with select option list -------------
- <select class="select-tabs">
- <option data-target="#home">Home</option>
- <option data-target='#profile'>Profile</option>
- <option data-target='#messages'>Messages</option>
- <option data-target='#settings'>Settings</option>
- </select>
- <div class="tab-content">
- <div class="tab-pane active" id="home">Home content</div>
- <div class="tab-pane" id="profile">Profile content</div>
- <div class="tab-pane" id="messages">Messages content</div>
- <div class="tab-pane" id="settings">Settings content</div>
- </div>
- jQuery('select.select-tabs').on('change', function () {
- jQuery(':selected', this).tab('show');
- });
- ------------ bxslider for custom pager slider -------------
- //slider
- jQuery('.bxslider').bxSlider();
- jQuery('.bxslider_single').bxSlider({
- pagerCustom: '#bx-pager',
- adaptiveHeight: true,
- nextText:'<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>',
- prevText:'<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>',
- //controls:false
- });
- jQuery("#bx-pager").bxSlider({
- slideWidth: 275,
- minSlides: 3,
- maxSlides: 3,
- slideMargin: 0,
- controls: true,
- pager: false,
- infiniteLoop: false,
- nextText:'<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>',
- prevText:'<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>',
- });
- Insert data from input to another input
- ---------------------------------------
- $("#kinginputgetid").keyup(function(){
- var get_input_val = $("#kinginputgetid").val();
- $("#kinginputpushid").val(get_input_val);
- });
- Ref:http://credshopping.com.br/formpage/
- Insert data from select option to another select option
- -------------------------------------------------------
- $('#kingdropgetid').on('change', function() {
- var get_select_val = $("#kingdropgetid").val();
- $("#kingdroppushid").val(get_select_val);
- })
- Ref:http://credshopping.com.br/formpage/
- Insert data from button to another input
- ---------------------------------------
- $('button.btn_select_kor').click(function(){
- $(this).toggleClass('button_clicked');
- var data_value = $(this).attr('data-btnvalue');
- $(this).parent().next().find("#amount_dhorsi").val(data_value);
- });
- Ref:http://credshopping.com.br/formpage-eight/
- Insert data from button to another select option
- ------------------------------------------------
- $('button.btn_select_kortw').click(function() {
- $(this).toggleClass('button_clickedtw');
- var data_value = $(this).attr('data-btnvalue');
- $(this).parent().next().find("#amount_seldhorsi").val(data_value);
- })
- Ref:http://credshopping.com.br/formpage-eight/
- // Slider with custom pagination content
- ==================================
- // For Slider
- jQuery('#banner-slider').slick({
- arrows: false,
- dots: false,
- pauseOnHover: false,
- fade: true,
- adaptiveHeight: true,
- slidesToShow: 1,
- autoplay: false,
- speed: 1000,
- });
- // Slider Pagination
- jQuery(".single-pagi").click( function() {
- jQuery(this).addClass('active').siblings().removeClass('active');
- var slidePos = jQuery(this).data('slide');
- jQuery('#banner-slider').slick('slickGoTo', slidePos);
- });
- ref : http://pitronot-ins.com/
- // Responsive Slicnav
- ==================================
- jQuery(document).ready(function(){
- jQuery('#nav').slicknav({
- duration: 1000,
- label: 'Menu',
- prependTo:"#mainmenu_area_mobile"
- });
- });
- // Responsive meanmenu
- ==================================
- jQuery('.menu_area').meanmenu({
- meanMenuContainer:'#mobile_nav',
- meanScreenWidth: "750"
- });
- source : https://github.com/meanthemes/meanMenu
- // For Slider slicknav
- =========================================
- jQuery(document).ready(function(){
- jQuery('#banner_slider').slick({
- arrows: false,
- dots: false,
- pauseOnHover: false,
- fade: true,
- slidesToShow: 1,
- slidesToScroll: 1,
- autoplay: true,
- speed: 1000,
- autoplaySpeed: 2000,
- });
- });
- // Jquery nicescroll plugin activator
- ============================================
- jQuery(document).ready(function(){
- jQuery("html").niceScroll({
- cursorminheight: 80,
- hidecursordelay: 400,
- cursorcolor:"#000",
- cursorwidth: "8px",
- scrollspeed: 40,
- mousescrollstep: 60,
- });
- });
- plugin link: https://github.com/inuyaksa/jquery.nicescroll
- // insert placeholder into input field by jquery
- ============================================
- jQuery('input#es_txt_email').attr('placeholder', 'Enter Your Mail');
- // addclass into li or some where you need when hover by jquery
- ============================================
- jQuery(document).ready(function(){
- jQuery("ul.new_navaright li.social").hover(
- function () {
- jQuery(this).addClass('active');
- },
- function () {
- jQuery(this).removeClass('active');
- }
- );
- });
- // / addclass and removeClass into div or some where you need when start scroll by jquery
- ============================================
- $(window).scroll(function(){
- if($(this).scrollTop() > 1 ){
- $('#targeted-div').addClass('head_color');
- }else{
- $('#targeted-div').removeClass('head_color');
- }
- });
- ---- or div hide/show smoothly where you need when start scroll by jquery---
- $(window).scroll(function(){
- if($(this).scrollTop() > 5){
- $('.mobile_header_area').slideUp();
- }else{
- $('.mobile_header_area').slideDown();
- }
- });
- // Jquery auto Full Screen Height
- ============================================
- // fullheight banner
- function fullheight(){
- var mainheight = $(window).outerHeight();
- $(".slider_item").height(mainheight);
- };
- fullheight();
- $(window).resize(function(){
- fullheight();
- });
- ------ or -------
- jQuery(document).ready(function() {
- var height = jQuery(window).height();
- jQuery('div.full_width_banner').height(height);
- });
- ---- or ---
- jQuery(document).ready(function() {
- function setHeight() {
- windowHeight = jQuery(window).innerHeight();
- jQuery('div.full_width_banner').css('height', windowHeight);
- };
- setHeight();
- jQuery(window).resize(function() {
- setHeight();
- });
- });
- ---- or ----
- function thirty_pc() {
- var height = jQuery(window).height();
- var thirtypc = (100 * height) / 100;
- thirtypc = parseInt(thirtypc) + 'px';
- jQuery("div.full_width_banner").css('height',thirtypc);
- };
- jQuery(document).ready(function() {
- thirty_pc();
- jQuery(window).bind('resize', thirty_pc);
- });
- Window height plus minus Jquery
- =======================================
- var full_height = jQuery(window).height();
- var header_height = jQuery(".header_amin_area").height();
- var side_height = full_height - header_height;
- jQuery("div.full_width_banner").height(side_height);
- ------ or ---------------------
- var full_height = jQuery("body").height();
- var header_height = jQuery(".head_main_area").height();
- var side_height = full_height - header_height;
- jQuery(".sidebar_fixed_menu_area").height(side_height);
- ------ or ---------------------
- var height = jQuery(window).height();
- var header = jQuery(".header_main_area").outerHeight();
- jQuery('.home_banner_mainarea').height(height-header);
- // margin top depend on header area
- ================================
- jQuery(document).ready(function() {
- var head_height = jQuery("header#main-header").height();
- jQuery('.areamenu_fro_ubermenu').css('margin-top', head_height);
- });
- // Header fixed Js
- =======================================
- var stickyTop = $('#stickyBanner').offset().top;
- $(window).on( 'scroll', function(){
- if ($(window).scrollTop() >= stickyTop) {
- $('#stickyBanner').css({position: "fixed", top: "0px"});
- } else {
- $('#stickyBanner').css({position: "relative", top: "0px"});
- }
- });
- // Footer fixed Js
- =======================================
- jQuery(document).scroll(function() {
- var scroll = jQuery(this).scrollTop();
- if (scroll >= 200) {
- jQuery("#sticky_footer, #pager").addClass("fixed");
- } else{
- jQuery("#sticky_footer, #pager").removeClass("fixed");
- }
- });
- // Dropdown-menu with toggle
- ---------------------------
- $("li.widget_accordion_drop ul").hide();
- $("li.widget_accordion_drop a").click(function(event){
- $(this).next("ul").slideToggle();
- event.preventDefault();
- });
- // Scroll to Div
- ==================================
- jQuery(document).ready(function (){
- jQuery("#goto_div_id").click(function (){
- jQuery('html, body').animate({
- scrollTop: jQuery("#target_div_id").offset().top
- }, 2000);
- });
- });
- ----------------- or ----------------
- jQuery("#banner_arrow").click(function(event) {
- event.preventDefault();
- jQuery("html, body").animate({scrollTop: jQuery("#where_to_go").offset().top - jQuery(".head_main_area").height()},600);
- });
- // Scroll to Div when div reach top 220px
- ==================================
- var $window = $(window),
- $stickyEl = $('section.widget:last-child'),
- elTop = $stickyEl.offset().top-220;
- $window.scroll(function() {
- $stickyEl.toggleClass('sticky', $window.scrollTop() > elTop);
- });
- // Scroll to Top basic
- ========================================
- jQuery(document).ready(function(){
- //Click event to scroll to top
- jQuery('#backtotop').click(function(){
- jQuery('html, body').animate({scrollTop : 0},800);
- return false;
- });
- });
- <!-- Scroll To Top Html Here -->
- <button type="button" id="backtotop">Scroll To Top</button>
- // Scroll to Top Advance
- ========================================
- jQuery(document).ready(function(){
- //Check to see if the window is top if not then display button
- jQuery(window).scroll(function(){
- if (jQuery(this).scrollTop() > 200) {
- jQuery('#backtotop').addClass('fixed');
- } else {
- jQuery('#backtotop').removeClass('fixed');
- }
- });
- //Click event to scroll to top
- jQuery('#backtotop').click(function(){
- jQuery('html, body').animate({scrollTop : 0},800);
- return false;
- });
- });
- <!-- Scroll To Top Start Here -->
- <button type="button" id="backtotop">Scroll To Top</button>
- <!-- Scroll To Top End There -->
- /*============== Scroll To Top style ===============*/
- button#backtotop {-moz-transition: all 0.5s;-o-transition: all 0.5s;-webkit-transition: all 0.5s;transition: all 0.5s;background: #760000;padding: 0;position: fixed;right: 40px;bottom: -150px;-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter: alpha(opacity=0);opacity: 0;width: 40px;color: #fff;font-size: 30px;}
- button#backtotop:hover {-webkit-animation: scrolltotop 0.3s infinite linear;-moz-animation: scrolltotop 0.3s infinite linear;-ms-animation: scrolltotop 0.3s infinite linear;animation: scrolltotop 0.3s infinite linear;-moz-transition: 0.2s;-o-transition: 0.2s;-webkit-transition: 0.2s;transition: 0.2s}
- button#backtotop.fixed {bottom: 20px;-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter: alpha(opacity=100);opacity: 1;}
- button#backtotop:focus {-moz-box-shadow: 0 0 0 0 #fff;-webkit-box-shadow: 0 0 0 0 #fff;box-shadow: 0 0 0 0 #fff;}
- @-webkit-keyframes scrolltotop{
- 0% {
- transform: translate(0, 0px);
- } 50% {
- transform: translate(0, 5px);
- } 100% {
- transform: translate(0, 0px);
- }
- }
- @-moz-keyframes scrolltotop{
- 0% {
- transform: translate(0, 0px);
- } 50% {
- transform: translate(0, 5px);
- } 100% {
- transform: translate(0, 0px);
- }
- }
- @keyframes scrolltotop {
- 0% {
- transform: translate(0, 0px);
- } 50% {
- transform: translate(0, 5px);
- } 100% {
- transform: translate(0, 0px);
- }
- }
- // Scroll to section id from navigation
- ========================================
- reference = https://jsfiddle.net/cse_tushar/Dxtyu/141/
- -------------------- or -----------------------
- // handle links with @href started with '#' only
- $(document).on('click', 'a[href^="#"]', function(e) {
- // target element id
- var id = $(this).attr('href');
- // target element
- var $id = $(id);
- if ($id.length === 0) {
- return;
- }
- // prevent standard hash navigation (avoid blinking in IE)
- e.preventDefault();
- // top position relative to the document
- var pos = $(id).offset().top -150;
- // animated top scrolling
- $('body, html').animate({scrollTop: pos});
- });
- reference = http://jsfiddle.net/dizel3d/1eamwt4e/
- ----------- or -------------------
- $(function() {
- $('a[href*=#]:not([href=#])').click(function() {
- var target = $(this.hash);
- target = target.length ? target : $('[name=' + this.hash.substr(1) +']');
- if (target.length) {
- $('html,body').animate({
- scrollTop: target.offset().top - 150
- }, 1000);
- return false;
- }
- });
- });
- reference = http://stackoverflow.com/questions/19012495/smooth-scroll-to-div-id-jquery
- ------------ this is html markup ----------------
- <a href="#section1">Go Section 1</a>
- <div id="section1">
- <!-- Content goes here -->
- </div>
- // Jquery FancyBox
- -------------------------
- jQuery(document).ready(function() {
- jQuery('.video_play')
- .attr('rel', 'media-gallery')
- .fancybox({
- openEffect : 'none',
- closeEffect : 'none',
- prevEffect : 'none',
- nextEffect : 'none',
- arrows : false,
- helpers : {
- media : {},
- buttons : {}
- }
- });
- });
- // singlePageNav Activate
- jQuery(document).ready(function(){
- jQuery('#nav, .slicknav_nav').singlePageNav({
- offset: jQuery('.mainmenu_main_area').outerHeight(),
- filter: ':not(.external)',
- speed : 2000,
- updateHash: false,
- });
- });
- // For Search hide show
- ======================================
- jQuery(document).ready(function(){
- jQuery('#search_btn').on('click', function(){
- jQuery(this).toggleClass('active').next('#search_form').toggleClass('active');
- });
- });
- <label id="search_btn" for="search_input"></label>
- <div id="search_form" class="fix">
- <input type="text" placeholder="מה ברצונך לחפש?" class="search_input" id="search_input" />
- <input type="submit" value="להגיש" class="search_submit" />
- </div>
- #search_form {opacity: 0;visibility: hidden;}
- #search_form.active{opacity: 1;visibility: inherit;}
- // Video Background
- jQuery(document).ready(function() {
- jQuery('#my-video').backgroundVideo({
- pauseVideoOnViewLoss: false,
- $videoWrap: jQuery('#video-wrap'),
- $outerWrap: jQuery('#outer-wrap'),
- preventContextMenu: true,
- parallaxOptions: {
- offset: -200,
- effect: 1.7
- }
- });
- });
- // Contact Form Page
- jQuery(document).ready(function() {
- // Add Captcha Wrapper Div
- jQuery('img.captcha_image').wrap('<div class="captcha_code fix"></div>');
- // Add Input Radio Wrapper Div
- jQuery('input[type=radio]').wrap('<div class="radio_button fix"></div>');
- // Radio Check to Add Remove Class
- jQuery('input[type=radio]').on('click', function () {
- jQuery(this).parents(".radio_button").addClass("checked");
- jQuery('input[type=radio]').each(function () {
- jQuery(this).is(':checked') ? jQuery(this).parents(".radio_button").addClass('checked') : jQuery(this).parents(".radio_button").removeClass('checked');
- });
- });
- });
- // Volenteer Radio Button
- jQuery(document).ready(function() {
- // Add Input Radio Wrapper Div
- jQuery('#location_select input[type=radio], #agree_select input[type=checkbox]').wrap('<div class="radio_button fix"></div>');
- jQuery('.radio_button').append('<span class="radio_check">[ ]</span>');
- // Radio Check to Add Remove Class
- jQuery('#location_select input[type=radio], #agree_select input[type=checkbox]').on('click', function () {
- jQuery(this).parents(".radio_button").addClass("checked").children('span.radio_check').text('[✓]');
- jQuery('#location_select input[type=radio], #agree_select input[type=checkbox]').each(function () {
- jQuery(this).is(':checked') ? jQuery(this).parents(".radio_button").addClass('checked').children('span.radio_check').text('[✓]') : jQuery(this).parents(".radio_button").removeClass('checked').children('span.radio_check').text('[ ]');
- });
- });
- // Add Input Radio Wrapper Div
- jQuery('.donation_form input[type=radio]').wrap('<div class="radio_button2 fix"></div>');
- jQuery('.radio_button2').append('<span class="radio_check"></span>');
- // Radio Check to Add Remove Class
- jQuery('.donation_form input[type=radio]').on('click', function () {
- jQuery(this).parents(".radio_button2").addClass("checked");
- jQuery('.donation_form input[type=radio]').each(function () {
- jQuery(this).is(':checked') ? jQuery(this).parents(".radio_button2").addClass('checked') : jQuery(this).parents(".radio_button2").removeClass('checked');
- });
- });
- });
- --------------------------------------------
- // Radio Button Wrrapper Funciton
- jQuery(function () {
- jQuery('div.payment_form1 input[type=radio]').wrap('<span class="radio_wrrap"></span>').addClass('amount_radio');
- });
- // Amount Select Option
- jQuery(function () {
- jQuery('input.amount_radio').on('click', function () {
- jQuery(this).parents("span.radio_wrrap").addClass("active");
- jQuery('input.amount_radio').each(function () {
- jQuery(this).is(':checked') ? jQuery(this).parents("span.radio_wrrap").addClass('active') : jQuery(this).parents("span.radio_wrrap").removeClass('active');
- });
- });
- });
- reference link https://www.ot-st.co.il/payment/
- --------------------------------------
- // Styled Select Option
- jQuery('select').each(function () {
- // select variable
- var $this = jQuery(this), numberOfOptions = jQuery(this).children('option').length;
- // Hide select option
- $this.addClass('select_hidden');
- // Add Select Option Wrapper
- $this.wrap('<div class="select fix"></div>');
- // Add New select menu div
- $this.after('<div class="select_styled fix"></div>');
- // select menu Variable
- var $styledSelect = $this.next('div.select_styled');
- // Menu text variable
- var menuText = $this.children('option').eq(0).text();
- // add text to select menu
- $styledSelect.text(menuText);
- // Add New list
- var $list = jQuery('<ul />',{
- 'class' : 'select_options fix'
- }).insertAfter($styledSelect);
- // Add list items
- for (i = 0; i < numberOfOptions; i++) {
- jQuery('<li />', {
- text : $this.children('option').eq(i).text(),
- rel : $this.children('option').eq(i).val(),
- }).appendTo($list);
- };
- // List item variable
- var $listItem = $list.children('li');
- // select menu click to open/close list
- $styledSelect.click(function(e) {
- e.stopPropagation();
- jQuery(this).toggleClass('active').next('ul.select_options').slideToggle();
- });
- // List item click to close menu
- $listItem.click(function(e) {
- e.stopPropagation();
- // add Text in select menu and removeClass
- $styledSelect.text(jQuery(this).text()).removeClass('active');
- // update select option value
- $this.val(jQuery(this).attr('rel'));
- // and Close list
- $list.slideUp();
- });
- // Document Click to styled select removeClass and list slideUp
- jQuery(document).click(function () {
- $styledSelect.removeClass('active');
- $list.slideUp();
- });
- });
- // List Arrow Addd
- jQuery(document).ready(function() {
- jQuery('.single_news_wedget ul li a').prepend('<i class="fa fa-caret-right"></i>');
- jQuery(".single_focus_slid>a.learn_more, .news_exarpt_cont a.news_link").each(function(){
- jQuery(this).appendTo(jQuery(this).prev('p'));
- });
- });
- // Mobile Menu Bg Effect
- jQuery(document).ready(function() {
- jQuery('a.slicknav_btn').click(function() {
- parentsdiv = jQuery(this).parents('div.header_content_area');
- if(parentsdiv.hasClass('fixed')) {
- parentsdiv.find('div.head_bg').removeClass('mmenu');
- } else {
- parentsdiv.find('div.head_bg').addClass('mmenu');
- }
- });
- });
- ===============================================
- JQuery Basic code
- ===============================================
- $(document).ready(function(){
- $('#nav').slicknav();
- $(".slider_area").click(function(){
- $(".header_area").addClass("main_header");
- });
- $(".cross_button").click(function(){
- $(".fixed_advert").hide(50000);
- });
- $(".testimonials-title h3").click(function(){
- $(this).animate({fontSize:"50px"});
- });
- jQuery(".tab-pane:first-child").addClass("active");
- jQuery(".nav-tabs li:first-child").addClass("active");
- });
- =========================
- ajax page link
- =========================
- $(document).ready(function() {
- $("header").find('a').on('click', function(e){
- e.preventDefault();
- ver linkloc = $(this).attr('href');
- $('#content').load('template/'+linkloc);
- });
- });
- --------------------------------------------------------
- /**
- * Javascript-Equal-Height-Responsive-Rows
- * https://github.com/Sam152/Javascript-Equal-Height-Responsive-Rows
- */
- (function($){'use strict';$.fn.equalHeight=function(){var heights=[];$.each(this,function(i,element){var $element=$(element);var elementHeight;var includePadding=($element.css('box-sizing')==='border-box')||($element.css('-moz-box-sizing')==='border-box');if(includePadding){elementHeight=$element.innerHeight();}else{elementHeight=$element.height();}
- heights.push(elementHeight);});this.css('height',Math.max.apply(window,heights)+'px');return this;};$.fn.equalHeightGrid=function(columns){var $tiles=this.filter(':visible');$tiles.css('height','auto');for(var i=0;i<$tiles.length;i++){if(i%columns===0){var row=$($tiles[i]);for(var n=1;n<columns;n++){row=row.add($tiles[i+n]);}
- row.equalHeight();}}
- return this;};$.fn.detectGridColumns=function(){var offset=0,cols=0,$tiles=this.filter(':visible');$tiles.each(function(i,elem){var elemOffset=$(elem).offset().top;if(offset===0||elemOffset===offset){cols++;offset=elemOffset;}else{return false;}});return cols;};var grids_event_uid=0;$.fn.responsiveEqualHeightGrid=function(){var _this=this;var event_namespace='.grids_'+grids_event_uid;_this.data('grids-event-namespace',event_namespace);function syncHeights(){var cols=_this.detectGridColumns();_this.equalHeightGrid(cols);}
- $(window).bind('resize'+event_namespace+' load'+event_namespace,syncHeights);syncHeights();grids_event_uid++;return this;};$.fn.responsiveEqualHeightGridDestroy=function(){var _this=this;_this.css('height','auto');$(window).unbind(_this.data('grids-event-namespace'));return this;};})(window.jQuery);
- /*for activation*/
- <script type="text/javascript">
- jQuery(function($) {
- $('.element').responsiveEqualHeightGrid();
- });
- </script>
- /* ========= or we can use ================== */
- /* Simple jQuery Equal Heights */
- !function(a){a.fn.equalHeights=function(){var b=0,c=a(this);return c.each(function(){var c=a(this).innerHeight();c>b&&(b=c)}),c.css("height",b)},a("[data-equal]").each(function(){var b=a(this),c=b.data("equal");b.find(c).equalHeights()})}(jQuery);
- /*for activation*/
- <script>
- jQuery('#equalheight div').equalHeights();
- </script>
- ---------------------------------------------------------
- /* ========================================
- Isotop portfolio dropdown category
- ========================================*/
- jQuery( function () {
- jQuery('.ui--custom-menu-bar').prepend('<ul class="filter_title"></ul>');
- jQuery('ul.portfolio-filters').find('li.title-item').appendTo('.filter_title');
- jQuery('ul.portfolio-filters').wrap('<div class="filters_dropdown"></div>');
- var first_title = jQuery('.portfolio-filters').find('li:first-child>a').text();
- jQuery('.filters_dropdown').prepend('<div class="dropdown_head"><div class="dropdown_title"></div><i class="ui--caret fontawesome-angle-down px18"></i></div>');
- jQuery('.dropdown_title').text(first_title);
- jQuery('ul.portfolio-filters>li>a').click(function() {
- var livetext = jQuery(this).text();
- jQuery('.dropdown_title').text(livetext);
- });
- });
- reference link http://sinus-dairy.dk.linux68.unoeuro-server.com/cases/
- /* ========================================
- Video Area when click video thumb play specific area video with auto replace through thumb Video
- ========================================*/
- jQuery('a.video_link').on('click', function(ev) {
- var vidlink = jQuery(this).attr('href');
- var videoid = vidlink.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);
- jQuery(this).parents('div.recent_lesson_content').find("#lesson_video")[0].src = "https://www.youtube.com/embed/"+ videoid[1] +"?rel=0&autoplay=1";
- ev.preventDefault();
- });
- // and html markup is
- ------------------------------
- <div class="recent_lesson_content fix">
- <div class="recent_lesson_big fix">
- <iframe id="lesson_video" width="420" height="315" src="https://www.youtube.com/embed/NG37uE6rbWU" frameborder="0" allowfullscreen></iframe>
- </div>
- <div class="recent_lesson_smalls fix">
- <div class="reles_small fix">
- <a href="https://www.youtube.com/watch?v=Eq8SK5Ay5ZY" class="video_link fix">
- <img src="<?php echo get_template_directory_uri(); ?>/img/recent_lesson2.png" alt="" />
- </a>
- </div>
- <div class="reles_small fix">
- <a href="https://www.youtube.com/watch?v=Eq8SK5Ay5ZY" class="video_link fix">
- <img src="<?php echo get_template_directory_uri(); ?>/img/recent_lesson2.png" alt="" />
- </a>
- </div>
- </div>
- </div>
- // And css
- --------------
- .recent_lesson{}
- .recent_lesson .upcm_event_head h3{
- color: #2DB673;
- }
- .recent_lesson_content{}
- .recent_lesson_big{
- margin-bottom: 15px;
- }
- iframe#lesson_video{
- width: 100%;
- height: 250px;
- }
- .recent_lesson_big img{
- display: block;
- width: 100%;
- }
- .recent_lesson_smalls{}
- .reles_small{
- float: left;
- width: 48%;
- margin-bottom: 15px;
- margin-right: 4%;
- }
- .reles_small:nth-child(2n+2){
- margin-right: 0px;
- }
- .reles_small img{
- display: block;
- }
- reference link http://www.jew-tahana.co.il/
- /* insert one div to another dive */
- jQuery("span.ginput_total").prependTo(".prdpage_addcart_area"); /* insert one div to another dive into first*/
- jQuery("span.ginput_total").appendTo(".prdpage_addcart_area"); /* insert one div to another dive into last*/
- jquery-detect-apple-touch-devices.js
- ===========================================
- jQuery(document).ready(function($){
- var deviceAgent = navigator.userAgent.toLowerCase();
- var agentID = deviceAgent.match(/(iphone|ipod|ipad)/);
- if (agentID) {
- // mobile code here
- }
- });
- /* Isotope Jquery */
- -----------------------
- jQuery(window).load(function() {
- var $container = jQuery('#container'),
- filters = {};
- $container.isotope({
- itemSelector : '.isotope_item',
- masonry: {
- columnWidth: 0
- }
- });
- // filter buttons
- jQuery('.filter .filter_list').click(function(){
- var $this = jQuery(this);
- // don't proceed if already selected
- if ( $this.hasClass('active') ) {
- return;
- }
- var $optionSet = $this.parents('.option-set');
- // change selected class
- $optionSet.find('.active').removeClass('active');
- $this.addClass('active');
- // store filter value in object
- // i.e. filters.color = 'red'
- var group = $optionSet.attr('data-filter-group');
- filters[ group ] = $this.attr('data-filter-value');
- // convert object into array
- var isoFilters = [];
- for ( var prop in filters ) {
- isoFilters.push( filters[ prop ] )
- }
- var selector = isoFilters.join('');
- $container.isotope({ filter: selector });
- return false;
- });
- });
- /*--- Mixit up lightbox gallery for each Category ---*/
- jQuery('#gallery_tabs li').click(function(){
- var selector = jQuery(this).attr('data-filter-value');
- if(selector == "*"){
- jQuery(".gallery_light").attr("data-fancybox-group", "gallery");
- } else{
- jQuery(selector).find(".gallery_light").attr("data-fancybox-group", selector);
- }
- });
- ==================================
- solve conflick slick slider into bootstrap tab content
- ------------------------------------------------------
- jQuery('[data-toggle="tab"]').on('shown.bs.tab', function (e) {
- jQuery('.tab_slider').slick('setPosition');
- });
- ==================================
- solve conflick slick slider into magnific popup content
- ------------------------------------------------------
- $('a.open-popup-post').magnificPopup({
- type:'inline',
- midClick: true,
- callbacks: {
- open: function() {
- $('#post_slider').slick('setPosition');
- var slideIndex = this.index;
- console.log(slideIndex);
- setTimeout(function() {
- $('.slider-products').slick('slickGoTo', parseInt(slideIndex), true);
- }, 100);
- },
- change: function() {
- $('#post_slider').slick('setPosition');
- var slideIndex = this.index;
- console.log(slideIndex);
- setTimeout(function() {
- $('#post_slider').slick('slickGoTo', parseInt(slideIndex), true);
- }, 100);
- }
- }
- });
- // sidemenu auto full as document height
- =======================================
- jQuery('#rightmenu').css('height', jQuery(document).height());;
- jQuery(document).resize(function(){
- jQuery('#rightmenu').css('height', jQuery(document).height());
- });
- // bx slider carousel responsive
- =============================
- var maxSlides,
- width = jQuery(window).width();
- if (width < 430) {
- maxSlides = 1;
- } else {
- maxSlides = 3;
- }
- var myslider = jQuery('.bxslider-inside').bxSlider({
- slideWidth: 250,
- minSlides: 1,
- maxSlides: maxSlides,
- pager:false
- });
- // event handlers for captions for slick slider.
- // On before slide change
- $('#kingcarosel_slider').on('beforeChange', function(event, slick, currentSlide, nextSlide){
- $( '.show_item_text' ).hide();
- $( '[data-slick-index = ' + nextSlide + '] .show_item_text' ).show('slow');
- });
- $('#kingcarosel_slider').on('afterChange', function(event, slick, currentSlide, nextSlide){
- });
- // show 1st caption on page load
- $( '.show_item_text' ).css('width','290px');
- $( this ).children().find( '.slick-current .show_item_text' ).show();
Advertisement
Add Comment
Please, Sign In to add comment