The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

[urgent] top Tab on homepage

View previous topic View next topic Go down

[urgent] top Tab on homepage

Post by indoromance on June 12th 2012, 11:17 am

i have install top tab on forumotion based on 2 script, but all doesn't work on forumotion.

first: installed at homepage message based on http://jqueryui.com/demos/tabs/#mouseover

Code:
<script>
   $(function() {
      $( "#tabs" ).tabs({
         event: "mouseover"
      });
   });
   </script>



<div class="demo">

<div id="tabs">
   <ul>
      <li><a href="#tabs-1">Nunc tincidunt</a></li>
      <li><a href="#tabs-2">Proin dolor</a></li>
      <li><a href="#tabs-3">Aenean lacinia</a></li>
   </ul>
   <div id="tabs-1">
      <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
   </div>
   <div id="tabs-2">
      <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>
   </div>
   <div id="tabs-3">
      <p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p>
      <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p>
   </div>
</div>

second based on http://www.pagecolumn.com/tool/top_tabs_generator.htm

installed on homepage message

Code:
<div id="tabco4">
    <ul>
        <li><a href="javascript:vd()">tab 1</a></li>
        <li><a href="javascript:vd()">tab 2</a></li>
        <li><a href="javascript:vd()">tab 3</a></li>
        <li><a href="javascript:vd()">tab 4</a></li>   
    </ul>
    <div>content tab1</div>
    <div >content tab2</div>
    <div>content tab3</div>
    <div >content tab4</div>
</div>

installed on CSS
Code:
.content {
  clear: both;
  border: #cfcfcf 1px solid;
  background-color: #eee9e9;
  width: 480px;
  height: 200px;
}
.ulnofloat {
  list-style-type: none;
  padding-left: 0px;
  margin: 0px;
}
.ullifloat {
  float : left;
  padding-left: opx;
  border-right:  #cfcfcf 1px solid;
  background-color: #cfcfcf;
  margin-right: 0px;
}
.ula {
  position: relative;
  text-decoration: none;
  display: block;
  padding: 5px 10px;
  cursor: pointer;
  font: bold 11px arial, sans-serif;
  color: #c00000;
}
#tabco4{
  position: relative;
  left : 263px;
  width: 480px;
  background-color: #6699cc;
  border-right: #6699cc 2px solid;
}
#tabco4 ul a:hover {
  color: #0062e6;
}

installed on Javascript management

Code:
window.onload = function(){
init()
}
var containercolor="#6699cc";

function init() {

var border="#cfcfcf 1px solid";
var conbkcolor="#eee9e9";
var tabbk="#cfcfcf";

t4 = new Bindtabs("tabco4",1,"mouseover","t",border,tabbk,conbkcolor,"400px");
t4.c();
}

function vd() {
}

function tabEvent(evt) {
    evt = (evt) ? evt : ((window.event) ? window.event : "");
    if (evt) {
    var elem = getTargetElement(evt);
    var actContainer = (elem.tagName=='A') ? elem.parentNode.parentNode.parentNode.id : elem.parentNode.parentNode.id;
    var tp = gettab(actContainer).position;
    var hvelem = (elem.tagName=='A') ? elem.parentNode : elem;
    var lielem =  (elem.tagName=='A') ? elem.parentNode.parentNode.getElementsByTagName('li') : elem.parentNode.getElementsByTagName('li');
 
    if ((evt.type == "mouseover") || (evt.type == "click")) {
      actIndex = getIndex(lielem,hvelem);
      if (actIndex==undefined) return;
 
        showContent(actContainer,actIndex);
      }
     }
}


function getIndex(arry,elem) {
   for (var i=0; i < arry.length; i++) {
      if (arry[i] == elem) {
      return i;
      }
   }
}
 
function showContent(container,act) {
   var contDiv = new Array;
   var j =0;
   var tab = gettab(container);
   var tp = tab.position;
   var vborder = tab.border;
   var vboxwidth = tab.width;
   var vtabcolor =tab.tabcolor;
   var contDiv0 = $$($(container),('div'));
   
   
   for(var i=0; i<contDiv0.length; i++){
      if (contDiv0[i].parentNode.id==container) {
         contDiv[j] = contDiv0[i];
         j = j+1;
      }
    }   

   contDiv[act].className = "content";      
      
   var vbkcolor = getbkColor(contDiv[act]);
   var tagul = getUL(container,tp);
   var tagula = $$(tagul,('a'));
   var tagulli = $$(tagul,('li'));

   for(var i=0; i<tagula.length; i++){
       tagula[i].className="ula";
   }

   for(var i=0; i<tagulli.length; i++){   
      tagulli[i].className="ullifloat";
   }
   tagul.className= "ulnofloat";
   
   $(container).style.borderRight = (ie6()==true) ?  containercolor +" 0px solid" : containercolor +" 2px solid";
   
   contDiv[act].style.display = "block";
   
   for(var i=0; i<contDiv.length; i++){   
      if (i != act) {
         contDiv[i].style.display = "none";
      }
   }

   var actitem = tagulli[act];

   var actitema = $$(actitem,('a'))[0];

   actitema.style.top ="1px";

   actitem.style.borderTop = vborder;

   actitema.style.backgroundColor =vbkcolor;   
    var marginRight_li = getmarginRight(actitem);   
   var marginBottom_li = getmarginBottom(actitem);   
   
   for(var i=0; i<tagulli.length; i++){
      
   if (marginRight_li=="0px") {         
         
         tagulli[i].style.borderLeft = (i==0) ? vborder : "#fff 0px";
               
   }
   
   
   if (i != act) {
   
   var a = $$(tagulli[i],'a')[0];
   
   a.style.top ="0px";   
   a.style.left ="0px";

   a.style.backgroundColor =vtabcolor;

   tagulli[i].style.borderTop = vborder;   
             
   }
   
  }
}
 
function bindEvent(container, e) {

var tp = gettab(container).position;
var ele = $$(getUL(container,tp),'li');

  for(var i=0; i<ele.length; i++){
      if (e=="click") {
        ele[i].onmouseover ="";
        ele[i].onclick = tabEvent;
      }
      if (e=="mouseover") {
        ele[i].onmouseover = tabEvent;
      }       
  }
}
   

function Bindtabs(id,activetab1,eventType,position,border,tabcolor,bkcolor,width) {   
    this.id = id;
   this.activetab1 = activetab1;
   this.eventType = eventType;
   this.position = position;
   this.border =border;
   this.tabcolor=tabcolor;
   this.bkcolor=bkcolor;
   this.width = width;

   this.c = function () {
   
showContent(this.id,this.activetab1);

   bindEvent(this.id,this.eventType);

   }
}

function getUL(id,ttp) {

if ((ttp=="t") || (ttp=="l") ||(ttp=="p")) {
   var ul = $$($(id),('ul'))[0];
}
else
{
   var n = $$($(id),('ul')).length;
   var ul = $$($(id),('ul'))[n-1];

}
return ul;
}

function gettab(id) {
return (id=="tabco4") ? t4 : t1;
}
 
function ie6() {
var appVer = navigator.appVersion.toLowerCase();
var iePos = appVer.indexOf('msie');
if (iePos !=-1) {
is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
is_major = parseInt(is_minor);
}

var is_ie = ((iePos!=-1));
var is_ie6 = (is_ie && is_major == 6);
return is_ie6;
}

function  getmarginBottom(obj) {
return (obj.currentStyle) ?  obj.currentStyle.marginBottom : getComputedStyle(obj,'').getPropertyValue('margin-bottom');
}

function getmarginRight(obj) {
return (obj.currentStyle) ?  obj.currentStyle.marginRight : getComputedStyle(obj,'').getPropertyValue('margin-right');
}

function getbkColor(obj) {
return (obj.currentStyle) ?  obj.currentStyle.backgroundColor : getComputedStyle(obj,'').getPropertyValue('background-color');
}

function getTargetElement(evt) {
    return (evt.target) ? ((evt.target.nodeType == 3) ? evt.target.parentNode : evt.target) : evt.srcElement;
}

function $(id){ return(document.getElementById(id)); }
function $$(e,tag) {return e.getElementsByTagName(tag);}

both script doesn't work on my forum....please help me Embarassed Embarassed




indoromance
Forumember

Male Posts : 84
Reputation : 1
Language : Indonesian
Location : Indonesia

http://www.indoromance.friendhood.net

Back to top Go down

Re: [urgent] top Tab on homepage

Post by nutsonlizards on June 13th 2012, 3:14 am


here this may help html
Code Below Smile


Last edited by nutsonlizards on June 13th 2012, 9:21 pm; edited 1 time in total

nutsonlizards
Forumember

Posts : 59
Reputation : 14
Language : London

http://www.redneckherpsforum.com/forum

Back to top Go down

Re: [urgent] top Tab on homepage

Post by indoromance on June 13th 2012, 7:51 pm

@nutsonlizards wrote:

here this may help html
Code:

<!--Create the Tabbed Panel widget and assign classes to each element-->
   <div class="TabbedPanels" id="TabbedPanels1">
      <ul class="TabbedPanelsTabGroup">
         <li class="TabbedPanelsTab">tab1</li>
         
         <li class="TabbedPanelsTab">tab2</li>
                       
         <li class="TabbedPanelsTab">tab3</li>
                        <li class="TabbedPanelsTab">tab4</li>
                        <li class="TabbedPanelsTab">tab5</li>
                        <li class="TabbedPanelsTab">tab6</li>
                       
                        <li class="TabbedPanelsTab">Live Radio Player</li>
      </ul>
      <div class="TabbedPanelsContentGroup">
         <div class="TabbedPanelsContent">tab1
</div>
         
         <div class="TabbedPanelsContent">Content tab2</div>
         <div class="TabbedPanelsContent">Content tab3</div>
                        <div class="TabbedPanelsContent">Content tab4</div>
                          <div class="TabbedPanelsContent">Content tab5</div>
                          <div class="TabbedPanelsContent">Content tab6 </div>
                         
                        <div class="TabbedPanelsContent">Content tab7</div>
      </div>
   </div>
<!--Initialize the Tabbed Panel widget object-->
 

<script type="text/javascript">
   var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
</script>

css
Code:

/* Horizontal Tabbed Panels */
.TabbedPanels {
   margin: 0px;
   padding: 0px;
   clear: both;
   width: 100%; /* IE Hack to force proper layout when preceded by a paragraph. (hasLayout Bug)*/
}
.TabbedPanelsTabGroup {
   margin: 0px;
   padding: 0px;
}
.TabbedPanelsTab {
   position: relative;
   top: 1px;
   float: left;
   padding: 4px 10px;
   margin: 0px 1px 0px 0px;
   font: bold 0.7em sans-serif;
   background-color: #DDD;
   list-style: none;
   border-left: solid 1px #CCC;
   border-bottom: solid 1px #999;
   border-top: solid 1px #999;
   border-right: solid 1px #999;
   -moz-user-select: none;
   -khtml-user-select: none;
   cursor: pointer;
}
.TabbedPanelsTabHover {
   background-color: #CCC;
}
.TabbedPanelsTabSelected {
   background-color: #EEE;
   border-bottom: 1px solid #EEE;
}
.TabbedPanelsTab a {
   color: black;
   text-decoration: none;
}
.TabbedPanelsContentGroup {
   clear: both;
   border-left: solid 1px #CCC;
   border-bottom: solid 1px #CCC;
   border-top: solid 1px #999;
   border-right: solid 1px #999;
   background-color: #EEE;
}
.TabbedPanelsContent {
   padding: 4px;
}
.TabbedPanelsContentVisible {
}
/* Vertical Tabbed Panels */
.VTabbedPanels .TabbedPanelsTabGroup {
   float: left;
   width: 10em;
   height: 20em;
   background-color: #EEE;
   position: relative;
   border-top: solid 1px #999;
   border-right: solid 1px #999;
   border-left: solid 1px #CCC;
   border-bottom: solid 1px #CCC;
}
.VTabbedPanels .TabbedPanelsTab {
   float: none;
   margin: 0px;
   border-top: none;
   border-left: none;
   border-right: none;
}
.VTabbedPanels .TabbedPanelsTabSelected {
   background-color: #EEE;
   border-bottom: solid 1px #999;
}
.VTabbedPanels .TabbedPanelsContentGroup {
   clear: none;
   float: left;
   padding: 0px;
   width: 30em;
   height: 20em;
}
JavaScript
Code:

<script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/widgets/tabbedpanels/SpryTabbedPanels.js">

hey bro....thank befor.....but your script doesnt work

indoromance
Forumember

Male Posts : 84
Reputation : 1
Language : Indonesian
Location : Indonesia

http://www.indoromance.friendhood.net

Back to top Go down

Re: [urgent] top Tab on homepage

Post by nutsonlizards on June 13th 2012, 9:18 pm

no it wasn't the script is was the css Smile i tested this . The css is from my forum so will need a bit of editing Smile
Code:
<script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/widgets/tabbedpanels/SpryTabbedPanels.js"></script>
Code:

/* Horizontal Tabbed Panels */
.TabbedPanels {
   margin: 0px;
   padding: 0px;
   clear: both;
   width: 100%; /* IE Hack to force proper layout when preceded by a paragraph. (hasLayout Bug)*/
}
.TabbedPanelsTabGroup {
   margin: 0px;
   padding: 0px;
}
.TabbedPanelsTab {
   position: relative;
   top: 1px;
   float: left;
   padding: 4px 10px;
   margin: 0px 5px 0px 0px;
        font-size: 18px;
   font: bold 1.000em sans-serif;
   background-color: #ff0;
   list-style: none;
   border-left: solid 1px #CCC;
   border-bottom: solid 1px #999;
   border-top: solid 1px #999;
   border-right: solid 1px #999;
   -moz-user-select: none;
   -khtml-user-select: none;
   cursor: pointer;
        border-radius: 5px 5px 0px 0px;
border: 1px solid #000000;
webkit-box-shadow: inset 0px 0px 12px #bbb !important;
  -moz-box-shadow: inset 0px 0px 12px #bbb !important;
  box-shadow:  inset 0px 0px 12px #bbb !important;
 
  font-weight: 590 !important;
  text-shadow: 0px 0px 2px #FFF !important;
}
.TabbedPanelsTabHover {
   background-color: #ccff00;
}
.TabbedPanelsTabSelected {
   background-color: #ccff00;
   border-bottom: 1px solid #EEE;
}
.TabbedPanelsTab a {
   color: black;
   text-decoration: none;
}
.TabbedPanelsContentGroup {
   clear: both;
   border-left: solid 2px #000;
   border-bottom: solid 2px #000;
   border-top: solid 2px #000;
   border-right: solid 2px #000;
   background-color: #fff;
        border-radius: 0px 0px 5px 5px;
        moz-box-shadow: 0px 0px 12px #666666;
    -webkit-box-shadow: 0px 0px 12px #666666;
    box-shadow: 0px 0px 12px #666666;
}
.TabbedPanelsContent {
   padding: 4px;
}
.TabbedPanelsContentVisible {
}
/* Vertical Tabbed Panels */
.VTabbedPanels .TabbedPanelsTabGroup {
   float: left;
   width: 10em;
   height: 20em;
   background-color: #EEE;
   position: relative;
   border-top: solid 1px #999;
   border-right: solid 1px #999;
   border-left: solid 1px #CCC;
   border-bottom: solid 1px #CCC;
}
.VTabbedPanels .TabbedPanelsTab {
   float: none;
   margin: 0px;
   border-top: none;
   border-left: none;
   border-right: none;
}
.VTabbedPanels .TabbedPanelsTabSelected {
   background-color: #EEE;
   border-bottom: solid 1px #999;
}
.VTabbedPanels .TabbedPanelsContentGroup {
   clear: none;
   float: left;
   padding: 0px;
   width: 30em;
   height: 20em;
}

Code:

<!--Create the Tabbed Panel widget and assign classes to each element-->
  <div class="TabbedPanels" id="TabbedPanels1">
      <ul class="TabbedPanelsTabGroup">
        <li class="TabbedPanelsTab">tab1</li>
       
        <li class="TabbedPanelsTab">tab2</li>
                       
        <li class="TabbedPanelsTab">tab3</li>
                        <li class="TabbedPanelsTab">tab4</li>
                        <li class="TabbedPanelsTab">tab5</li>
                        <li class="TabbedPanelsTab">tab6</li>
                       
                        <li class="TabbedPanelsTab">tab7</li>
      </ul>
      <div class="TabbedPanelsContentGroup">
        <div class="TabbedPanelsContent">tab1
</div>
       
        <div class="TabbedPanelsContent">Content tab2</div>
        <div class="TabbedPanelsContent">Content tab3</div>
                        <div class="TabbedPanelsContent">Content tab4</div>
                          <div class="TabbedPanelsContent">Content tab5</div>
                          <div class="TabbedPanelsContent">Content tab6 </div>
                         
                        <div class="TabbedPanelsContent">Content tab7</div>
      </div>
  </div>
<!--Initialize the Tabbed Panel widget object-->
 


 

<script type="text/javascript">
   var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
</script>

nutsonlizards
Forumember

Posts : 59
Reputation : 14
Language : London

http://www.redneckherpsforum.com/forum

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum