Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type='text/javascript'>
- //
- // Tabbed Blogger gadgets by MS-potilas 2011
- // see http://yabtb.blogspot.com/
- //
- // Configuration:
- //
- // ID used for tab elements (for second set of tabs, search & replace all tabnav0 by tabnav1 etc):
- var tabsID = "tabnav0";
- // number of gadgets (following this one) to tabify
- var tabnav0_count = 3;
- // optional titles, empty strings or empty array:
- var tabnav0_tabtitles = [];
- //
- var tabnav0_hideH2 = true;
- //
- var tabnav0_hidechildH2 = true;
- </script>
- <style type="text/css">
- #tabnav0h {
- position:relative;
- top: 24px;
- height: 1px;
- border: 0;
- background:#cccccc;
- margin-right:-30px;
- border-right:4px solid #dddddd;
- display:none;
- }
- #tabnav0v {
- z-index:0;
- position:absolute;
- left:-6px;
- top: 24px;
- width: 1px;
- height: 30px;
- border-top:15px solid #e8e8e8;
- background:#f2f2f2;
- border-bottom:15px solid #f8f8f8;
- display:none;
- }
- #tabnav0 {
- z-index:0;
- position:relative;
- padding:0;
- list-style:none;
- line-height:21px;
- left:-6px;
- margin-right:-50px;
- white-space:nowrap;
- display:none;
- }
- #tabnav0 li {
- float:left;
- padding: 0 3px 0 0;
- }
- #tabnav0 a {
- text-shadow: 1px 1px 1px #ffffff;
- -webkit-border-radius:3px 3px 0 0;
- -moz-border-radius:3px 3px 0 0;
- border-radius:3px 3px 0 0;
- padding: 0 6px;
- display:block;
- color:#555599;
- text-decoration:none;
- font-size:10px;
- font-weight:normal;
- background: #eeeeee url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAKCAYAAAB10jRKAAAABHNCSVQICAgIfAhkiAAAAB5JREFUCJljePfu3X+mf//+MTD9//+fAcLCxoWLAQAeuR6v7ndCjQAAAABJRU5ErkJggg==) repeat-x bottom left;
- margin:0;
- margin-top:2px;
- height:20px;
- border: 1px solid #eeeeee;
- border-right-color: #aaaaaa;
- border-bottom-color: #cccccc;
- }
- #tabnav0 .here a {
- text-shadow: 1px 1px 1px #bbbbbb;
- padding: 1px 5px;
- height:20px;
- margin-top:0px;
- font-weight:bold;
- color:#000000;
- font-size:11px;
- border: 1px solid #dddddd;
- border-right-color:#aaaaaa;
- border-bottom-color:#ffffff;
- }
- #tabnav0 .here a:link,
- #tabnav0 .here a:visited {
- padding: 1px 5px;
- background:#ffffff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAKCAYAAAB10jRKAAAABHNCSVQICAgIfAhkiAAAAB9JREFUCJlj+PDhx38mJiZGBiZGRgYGGIuRAYcYAwMAu14EDIt2gFQAAAAASUVORK5CYII=) repeat-x;
- }
- #tabnav0 a:hover,
- #tabnav0 a:active,
- #tabnav0 .here a:hover,
- #tabnav0 .here a:active {
- background:#f4f4f4;
- border-bottom-color: #ededed;
- }
- </style>
- <script type='text/javascript'>
- if(typeof tabsIDs == 'undefined') var tabsIDs = [];
- var tabnav0_id = "";
- function tabnav0_avaa(nimi) {
- for(var i = 0; i<tabnav0_tabids.length; i++) {
- document.getElementById(tabnav0_tabids[i]).style.display = "none";
- if(tabsIDs[tabnav0_tabids[i]])
- document.getElementById(tabsIDs[tabnav0_tabids[i]]).style.display = "none";
- document.getElementById("tab_"+tabnav0_tabids[i]).className = "";
- }
- toshow = document.getElementById(tabnav0_id).style.display;
- document.getElementById(nimi).style.display=toshow;
- if(tabsIDs[nimi])
- document.getElementById(tabsIDs[nimi]).style.display = toshow;
- document.getElementById("tab_"+nimi).className = "here";
- tabsIDs[tabnav0_id] = nimi;
- }
- if(typeof addLoadEvent !== 'function') {
- function addLoadEvent(func)
- {
- var oldonload = window.onload;
- if (typeof window.onload != 'function') {
- window.onload = func;
- } else {
- window.onload = function() {
- oldonload();
- func();
- }
- }
- }
- }
- var tabnav0_tabids = [];
- function tabnav0_inittabs() {
- var tabsID = "tabnav0";
- var elm = document.getElementById(tabsID);
- elm.style.display="block";
- elm = elm.parentNode.parentNode;
- elm.style.marginBottom="-24px";
- tabnav0_id = elm.id;
- var elmo = elm.firstChild;
- while(elmo && elmo.nodeType != 1)
- elmo = elmo.nextSibling;
- if(elmo && elmo.nodeName == "H2" && (tabnav0_hideH2 || elmo.innerHTML == ""))
- elmo.style.display = "none";
- else if(elmo && elmo.nodeName == "H2")
- document.getElementById("tabnav0v").style.top = (14+24)+"px"; // H2 elem.height + tabnav0v.top
- for(var i = 0 ; i < tabnav0_count ; i++) {
- elm = elm.nextSibling;
- while(elm && elm.nodeType != 1)
- elm = elm.nextSibling;
- if(!elm) break;
- tabnav0_tabids[i] = elm.id;
- }
- document.getElementById(tabsID+"h").style.display="block";
- document.getElementById(tabsID+"v").style.display="block";
- var inht = '';
- for(var i = 0; i<tabnav0_tabids.length; i++) {
- elm = document.getElementById(tabnav0_tabids[i]);
- elm = elm.firstChild;
- while(elm && elm.nodeType != 1)
- elm = elm.nextSibling;
- if (elm && elm.nodeName != "H2") {
- elm = elm.firstChild;
- while(elm && elm.nodeType != 1)
- elm = elm.nextSibling;
- }
- if(elm && elm.nodeName == "H2") {
- if(tabnav0_hidechildH2)
- elm.style.display = "none";
- if(!tabnav0_tabtitles[i] || tabnav0_tabtitles[i] == '')
- tabnav0_tabtitles[i] = elm.innerHTML;
- }
- if(!tabnav0_tabtitles[i] || tabnav0_tabtitles[i] == '')
- tabnav0_tabtitles[i] = tabnav0_tabids[i];
- elm = document.getElementById("tab_"+tabnav0_tabids[i]);
- inht += '<li id="tab_' + tabnav0_tabids[i] + '"><a href="#" onclick="tabnav0_avaa(\''+tabnav0_tabids[i]+'\');this.blur();return false;">'+tabnav0_tabtitles[i]+'</a></li>';
- }
- document.getElementById(tabsID).innerHTML = inht;
- tabnav0_avaa(tabnav0_tabids[0]);
- }
- if(tabnav0_count) {
- document.write('<div id="'+tabsID+'h"></div><ul id="'+tabsID+'"></ul><div id="'+tabsID+'v"></div>');
- addLoadEvent(tabnav0_inittabs);
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement