This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="top-line-wrapper" id="top-line"> | |
<div class="top-line-anchor"></div> | |
<div id="top-line-fixed" class="top-line"> | |
your content | |
</div> | |
</div> | |
var StickyElement = function(node){ | |
var doc = $(document), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:invalid { | |
box-shadow: none; | |
} | |
:-moz-submit-invalid { | |
box-shadow: none; | |
} | |
:-moz-ui-invalid { | |
box-shadow:none; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cutLongText() { | |
var elem, size, text; | |
size = 120; | |
elem = $('your classes or id'); | |
$.each(elem,function(){ | |
text = $(this).html(); | |
if (text.length > size) {text = text.slice(0, size);} | |
$(this).html(text + '...'); | |
}); | |
console.log(elem); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span class="form-group"> | |
<span id="decrease">-</span> | |
<input id="htop" type="text" value="1"> | |
<span id="increase">+</span> | |
</span> | |
var elm = $('#htop'); | |
function spin( vl ) { | |
elm.val( parseInt( elm.val(), 10 ) + vl ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$('.answer').hide(); | |
$('.main h2').on('click', function () { | |
var $answer = $(this).next('.answer'); | |
if ($answer.is(':hidden')) { | |
$answer.slideDown(); | |
$(this).addClass('close'); | |
} else { | |
$answer.slideUp(); | |
$(this).removeClass('close'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win = $(window); | |
function windowSize(){ | |
if ($(window).width() <= '600' && win.scrollTop() > 600){ | |
$('.order-mobile').fadeIn('slow'); | |
} else { | |
$('.order-mobile').fadeOut('slow'); | |
} | |
} | |
$(window).load(windowSize()); // при загрузке |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var topLine = $('.top-line'); | |
$(window).scroll(function (){ | |
var top = $(this).scrollTop(); | |
if (top > 120) { | |
topLine.addClass('fixed'); | |
} else { | |
topLine.removeClass('fixed'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
-webkit-appearance: none; | |
-webkit-border-radius: 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(" your element").click(function() | |
{ | |
$(this).next("your element").slideToggle('normal'); | |
}); |