If your website is multilingual, it can be useful to detect the browser language to use this language as the default. The code below will return the language used by the client’s browser.
View loader.css
This file contains 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
#overlay{ | |
position:fixed; | |
z-index:99999; | |
top:0; | |
left:0; | |
bottom:0; | |
right:0; | |
background:rgba(255,255,255,1); | |
transition: 1s 0.4s; | |
} |
View scroller-bottom.js
This file contains 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
``` | |
$(window).scroll(function(){ | |
if($(window).scrollTop() + $(window).height() > $(document).height() - <?php echo( s3_option('s3cc_fixed_trigger') == '' ? 100 : s3_option('s3cc_fixed_trigger') );?>) { | |
$('.s3cc-fixed').css('position','static'); | |
}else{ | |
$('.s3cc-fixed').css('position','fixed'); | |
} | |
}); | |
``` |
View Display number of Facebook fans in full text
This file contains 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
If you have a Facebook page for your website or blog, you might want to display how many fans you have. This snippet will help you to get your Facebook fan count, in full text. Don’t forget to add your page ID on line 2. |
View Download & save a remote image on your server
This file contains 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
Downloading an image on a remote server and saving it on your own server is useful when building websites, and it’s also very easy to do. The two lines of code below will do it for you. |
View Create Data URI’s
This file contains 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
Data URI’s can be useful for embedding images into HTML/CSS/JS to save on HTTP requests. The following function will create a Data URI based on $file for easier embedding. |
View Auto convert URL into clickable hyperlink
This file contains 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
In wordpress, if you want to auto convert all URLs in your string into clickable hyperlinks, you can actually do it using the built-in function make_clickable(). If you need to do that outside of wordpress, you can refer to the function’s source code at wp-includes/formatting.php |
View Find All Links on a Page
This file contains 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
Using the DOM, you can easily grab all links from any webpage. |
View Extract keywords from a webpage
This file contains 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
The title said it all: A great code snippet to easily extract meta keywords from any webpage. |
NewerOlder