Skip to content

Instantly share code, notes, and snippets.

@wireinet
wireinet / topmenu.js
Last active December 5, 2016 14:40
fixed-menu
$(document).ready(function(){
var $menu = $(".menu-containers");
$(window).scroll(function(){
if ( $(this).scrollTop() > 100 && $menu.hasClass("top-menu-hide") ){
$menu.removeClass("top-menu-hide").addClass("top-menu-unhide"); }
else if($(this).scrollTop() <= 100 && $menu.hasClass("top-menu-unhide")) {
$menu.removeClass("top-menu-unhide").addClass("top-menu-hide"); }
@wireinet
wireinet / jquery_tabs
Last active June 19, 2019 08:07 — forked from agragregra/jQuery Tabs Short
Tabs on JQuery
HTML:
<div class="wrapper">
<div class="tabs">
<span class="tab">Вкладка 1</span>
<span class="tab">Вкладка 2</span>
<span class="tab">Вкладка 3</span>
</div>
<div class="tab_content">
<div class="tab_item">Содержимое 1</div>
<div class="tab_item">Содержимое 2</div>
@wireinet
wireinet / favicon
Last active December 5, 2016 14:38
favicon
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
@wireinet
wireinet / totop.js
Last active November 14, 2021 10:16
button to top
// totop
$(document).ready(function(){
const totop = $(".totop");
// hide #back-top first
totop.hide();
// fade in #back-top
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
@wireinet
wireinet / font-smooth.css
Last active June 19, 2019 08:04
antialias font
* {
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@wireinet
wireinet / hidenmenu.js
Created January 5, 2017 13:31
reveal menu by scroll
$(document).ready(function(){
$(".menu").hide();
$(function(){
$(window).scroll(function(){
if ($($(this)).scrollTop() > 100)
{
$(".menu").fadeIn();
}
else {$(".menu").fadeOut();}
});
// Определение Браузера
var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "Other";
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown";
},
searchString: function (data) {
for (var i = 0; i < data.length; i++) {
var dataString = data[i].string;
this.versionSearchString = data[i].subString;
$(function(){
var hashTagActive = "";
$(".scroll").on("click touchstart" , function (event) {
if(hashTagActive != this.hash) { //this will prevent if the user click several times the same link to freeze the scroll.
event.preventDefault();
//calculate destination place
var dest = 0;
if ($(this.hash).offset().top > $(document).height() - $(window).height()) {
dest = $(document).height() - $(window).height();
@wireinet
wireinet / jquery wp no conflict.js
Last active July 28, 2021 11:37
Wordpress jquery code in file
(function($) {
//your code
})(jQuery);
// или
jQuery( document ).ready(function( $ ){
//code
});
// attach file
(function() {
'use strict';
$('.input-file').each(function() {
var $input = $(this),
$label = $input.next('.js-labelFile'),
labelVal = $label.html();