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
| .element { | |
| background: url('image.png') no-repeat 0 0; | |
| background: rgba(0,0,0,0) url('image.svg') no-repeat 0 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Ajax</title> | |
| <!-- Meta --> | |
| <meta charset="utf-8" /> | |
| <meta name="description" content="" /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.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
| <div class="loader"></div> |
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
| define('FS_METHOD','direct'); |
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 _clicked = false; | |
| $('_').on('click', function(e) { | |
| if (!_clicked) { // First click | |
| about_clicked = true; | |
| console.log('true'); | |
| } else { // Second click | |
| about_clicked = false; |
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 pushSupport = $('html').hasClass('history') ? true : false; // does html have class .history? (modernizr.js required) | |
| var toLoad = $('.element').attr('href'); // toLoad variable is .element's href attribute | |
| if (pushSupport === true) { // if html does have class .history | |
| history.replaceState(null, null, toLoad); // replace URL with the new href | |
| } |
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 isMobile = { | |
| Android: function() { | |
| return navigator.userAgent.match(/Android/i) ? true : false; | |
| }, | |
| BlackBerry: function() { | |
| return navigator.userAgent.match(/BlackBerry/i) ? true : false; | |
| }, | |
| iOS: function() { | |
| return navigator.userAgent.match(/iPhone|iPod/i) ? true : false; |
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 siteURL = 'http://www.website.com/'; | |
| if ( document.domain == 'localhost' ) siteURL = "http://localhost/website/"; | |
| // Example | |
| $('.element').css('background-image', 'url("' + siteURL + 'assets/img/background.png")'); | |
| $('.element').next().find('img').attr('src', siteURL + 'assets/img/image.png'); |
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 preloadImages(arrayOfImages) { | |
| $(arrayOfImages).each(function(){ | |
| $('<img/>')[0].src = this; | |
| }); | |
| } | |
| // Usage | |
| preloadImages([ | |
| 'img/1.jpg', | |
| 'img/2.jpg', |
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
| // Remove specific menus from WP backend | |
| function remove_menus () { | |
| global $menu; | |
| $restricted = array(__('Posts'),__('Comments'),__('Links'),__('Media')); // Can be whatever you want | |
| end ($menu); | |
| while ( prev($menu) ) { | |
| $value = explode( ' ',$menu[key($menu)][0] ); | |
| if ( in_array($value[0] != NULL?$value[0]:"" , $restricted) ) { | |
| unset( $menu[key($menu)] ); | |
| } |
OlderNewer