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
// sort by class | |
var mylist = jQuery('ul'); | |
var listitems = mylist.children('li').get(); | |
listitems.sort(function(a, b) { | |
var compA = jQuery(a).attr("class"); | |
var compB = jQuery(b).attr("class"); | |
return (compA < compB) ? -1 : (compA > compB) ? 1 : 0; | |
}) | |
jQuery(document).ready(function(){ |
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
I can't test it on safari/mac but Safari and Google Chrome uses WebKit rendering engine so it is very likely that every hack works in Safari. | |
Google Chrome is rather new player but it rapidly increases and there is a need for using specific styles only for that browser. Thats why i am looking for hack for Google Chrome. | |
Hack 1: @media and -webkit-min-device-pixel-ratio | |
Testsuite: This text is red in Google Chrome. | |
This hack uses webkit specific feature. | |
/* will be red only in google chrome */ |
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
// mixin retina images | |
@mixin background-image-retina($file, $type, $width, $height) { | |
background-image: url($file + '.' + $type); | |
@media | |
only screen and (-webkit-min-device-pixel-ratio: 1.5), | |
only screen and (-o-min-device-pixel-ratio: 3/2), | |
only screen and (min--moz-device-pixel-ratio: 1.5), | |
only screen and (min-device-pixel-ratio: 1.5) { | |
& { |
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
//css | |
body { | |
zoom: 200%; | |
-moz-transform: scale(2); | |
-moz-transform-origin: 0 0; | |
} | |
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
<!-- code change to show price ranges --> | |
<?php | |
$product = Mage::getModel('catalog/product')->load($_product->getId()); | |
$prodPrice = $product->getPrice(); | |
if($product->getOptions()){ | |
$minPrices=array(); | |
$maxPrices=array(); | |
foreach ($product->getOptions() as $_option) { | |
switch ($_option->getType()) { | |
case 'field': case 'file': case 'area': case 'date_time': case 'date': case 'time': |
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
function clearText(field){ | |
if (field.defaultValue == field.value) field.value = ''; | |
else if (field.value == '') field.value = field.defaultValue; | |
//<input type="text" onblur="clearText(this)" onfocus="clearText(this)" value="value"/> | |
} |
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
<script type="text/javascript"> | |
jQuery( function($) { | |
$('.tabs-block').each( function() { | |
var container = $(this); | |
container.find('.tab-nav li a').click( function () { | |
$(this).parent().addClass( 'selected-tab' ).siblings().removeClass( 'selected-tab' ); | |
container.find('.tab-content').hide().filter(this.hash).show(); | |
return false; | |
}).eq(0).click(); | |
}); |
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
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('.accordion > .accordion-title').click(function() { | |
$(this).siblings(".accordion-title").removeClass('selected'); | |
$(this).siblings(".accordion-content").removeClass('accordion-show'); | |
if($(this).hasClass('selected')) { | |
$(this).removeClass('selected'); | |
$(this).next(".accordion-content").removeClass('accordion-show'); | |
}else{ |
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
// jQuery | |
$('.selector').contents().filter(function() { return this.nodeType === 3; }).remove(); |
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
<!-- | |
<ul class="carousel-block"> | |
<li>1</li> | |
<li>2</li> | |
<li>3</li> | |
<li>...</li> | |
</ul> | |
--> | |
<script type="text/javascript"> |
OlderNewer