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
Drupal.theme.ulToSelect = function(selector){ | |
$(selector).once('ulToSelect', function(){ | |
var ul = $(this), | |
select = '<select id="select"/>'; | |
ul.after(select); | |
ul.find('li').each(function(){ | |
var text = $(this).text(), | |
link = $(this).find('a').attr('href'); |
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 theme_css_alter(&$css) { | |
// Css Not allowed for theming | |
$not_allowed_css = array( | |
'modules/system/system.base.css', | |
'modules/system/system.menus.css', | |
'modules/system/system.messages.css', | |
'modules/system/system.theme.css', | |
'sites/all/modules/contrib/ctools/css/ctools.css', | |
); | |
foreach ($css as $css_filename => $css_settings) { |
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
//itemLength is the number of element and $item is your item | |
for(var i = 0; i < itemLength; i=i+4) { | |
$items | |
.slice(i, i+4) | |
.wrapAll('<div class="group"/>'); | |
} |
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
/* | |
Use margin-top or left to the direction | |
Replace $containerItems and .slide | |
*/ | |
function gallerySlide(direction) { | |
var firstSlide = $containerItems.find('.slide:first-child'), | |
lastSlide = $containerItems.find('.slide:last-child'), | |
duration = 400; | |
// Prev Direction | |
if(direction == 'prev') { |
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
/** | |
* Touch events | |
*/ | |
// wrapper is a DOM element | |
wrapper.touch = {} | |
wrapper.get(0).ontouchstart = function(e) { | |
// Store start position | |
wrapper.touch.x = e.touches[0].clientX; | |
}; |