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
PHP: | |
<?php $background = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'full' ); ?> | |
HTML: | |
<div style="background-image: url('<?php echo $background[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
// http://anton.shevchuk.name/javascript/jquery-for-beginners/ | |
$(document).ready(function(){ | |
$(".accordion h3:first").addClass("active"); | |
$(".accordion p:not(:first)").hide(); | |
$(".accordion h3").click(function(){ | |
$(this).next("p").slideToggle("slow") | |
.siblings("p:visible").slideUp("slow"); | |
$(this).toggleClass("active"); |
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
/* http://stackoverflow.com/questions/1464934/text-align-justify-and-images */ | |
<style> | |
.justify-image{ text-align: justify;} | |
.justify-image img{display:inline-block;} | |
.justify-image:after{content:""; display: inline-block; width: 100%; height: 0;} | |
</style> | |
<p class="justify-image"> | |
<img src="/path/img.jpg" alt="my image"> | |
<img src="/path/img.jpg" alt="my image"> |
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 browser() { | |
var ua = navigator.userAgent; | |
if (ua.search(/MSIE/) != -1) return 'Internet Explorer'; | |
if (ua.search(/Firefox/) != -1) return 'Firefox'; | |
if (ua.search(/Opera/) != -1) return 'Opera'; | |
if (ua.search(/Chrome/) != -1) return 'Google Chrome'; | |
if (ua.search(/Safari/) != -1) return 'Safari'; | |
if (ua.search(/Konqueror/) != -1) return 'Konqueror'; | |
if (ua.search(/Iceweasel/) != -1) return 'Debian Iceweasel'; |
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 os() { | |
var os = 0; | |
if (navigator.userAgent.indexOf('Windows') != -1) return 'Windows'; | |
if (navigator.userAgent.indexOf('Linux') != -1) return 'Linux'; | |
if (navigator.userAgent.indexOf('Mac') != -1) return 'Mac'; | |
if (navigator.userAgent.indexOf('FreeBSD') != -1) return 'FreeBSD'; | |
} |
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
$('a').click(function() { | |
var clicks = $(this).data('clicks'); | |
if (clicks) { | |
alert('odd number of clicks'); | |
} else { | |
alert('even number of clicks'); | |
} | |
$(this).data("clicks", !clicks); | |
}); |
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
http://jsfiddle.net/thirtydot/EDp8R/ | |
#container { | |
border: 2px dashed #444; | |
height: 125px; | |
text-align: justify; | |
/* just for demo */ | |
min-width: 612px; | |
} |
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
$('.active-ads-campaign__format__item').click(function(e) { | |
e.preventDefault(); | |
var $this = $(this); | |
var currentSlide; | |
sliderTwo.goToSlide($this.data('format')); | |
currentSlide = sliderTwo.getCurrentSlide(); | |
$this.addClass('active') | |
.siblings('.active-ads-campaign__format__item').removeClass('active'); | |
}); |
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
http://bavotasan.com/2011/style-select-box-using-only-css/ | |
<select name="timepass" class="fast-approval__select"> | |
<option>Суточная посещаемость Вашего сайта</option> | |
<option>Driving</option> | |
<option>Internet</option> | |
<option>Movie</option> | |
<option>Music</option> | |
<option>Reading</option> | |
<option>Sports</option> | |
</select> |
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
// http://stackoverflow.com/questions/4917664/detect-viewport-orientation-if-orientation-is-portrait-display-alert-message-ad | |
if(window.innerHeight > window.innerWidth){ | |
alert("Please use Landscape!"); | |
} |
OlderNewer