Skip to content

Instantly share code, notes, and snippets.

@dev-ext
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dev-ext/c67357464e4e5d98c2e6 to your computer and use it in GitHub Desktop.
Save dev-ext/c67357464e4e5d98c2e6 to your computer and use it in GitHub Desktop.
javascript code snippet
site.baner = function () {
var s = {};
s.baner = jQuery(".image_baner");
s.baner.each(function(){
s.src = jQuery(this).attr('src');
s.back = 'background-image:url('+s.src+');';
jQuery(this).parent().attr("style",s.back);
});
};
site.tabbed = function () {
var s = {};
s.tabcont = jQuery(".tab_content");
s.tabtitle = jQuery(".tab_title");
s.tabtitle.click(function(event){
event.preventDefault();
s.curritem = jQuery(this).attr("href");
s.tabcont.hide();
jQuery(s.curritem).show();
s.tabtitle.removeClass('active');
jQuery(this).addClass('active');
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment