[ 10 posts ]

Dan Cowen

  • Username: hattersville
  • Joined: Mon May 07, 2012 8:16 am
  • Posts: 8
  • Offline
  • Profile

YUI 3.5.0 Orientation Left/Right

Post Posted: Mon May 07, 2012 8:27 am
+0-
Hello all,

My site has been using YUI Tabview 2.6, and I am beginning to transition to 3.5 due to some recent bugs.

However, my site requires a Left Orientation to function.

I have been unable to adjust the orientation in 3.5.0. Is this possible at this time, and if so, can anyone help me out?

In 2.6 the code to make it work was:
<script type="text/javascript"> var myTabs = new YAHOO.widget.TabView('demo', {orientation: 'left'}); </script>

In 3.5.0, the similar line of code was this one:
<script>YUI().use('tabview', function(Y) {var tabview = new Y.TabView({srcNode: '#demo'}); tabview.render();});</script>

Unfortunately after several different manipulations of this line, nothing worked. It stayed at the top.

I thank you in advance for your assistance with this.

Dan

Jeff Pihach

YUI Contributor

  • Username: hatch
  • Joined: Wed Dec 08, 2010 9:20 am
  • Posts: 37
  • Twitter: fromanegg
  • GitHub: hatched
  • Gists: hatched
  • IRC: hatch
  • Offline
  • Profile
Tags:

Re: YUI 3.5.0 Orientation Left/Right

Post Posted: Mon May 07, 2012 7:35 pm
+0-
Hi Dan,

As far as I know this is not a configurable option. probably because it is easily accomplished with just a few css tweaks.

Taking the basic example here: http://yuilibrary.com/yui/docs/tabview/ ... romjs.html

By looking at the tabview markup you'll notice that the tabs are in a ul and the panels are in a div. By floating the ul and div left, removing the display: inline-block on the handles you will now have handles that are aligned to the left side of the panels.

I hope this helps point you in the right direction!

Juan Ignacio Dopazo

YUI Contributor

  • Username: jdopazo
  • Joined: Fri Oct 02, 2009 5:39 am
  • Posts: 620
  • Location: Buenos Aires, Argentina
  • Twitter: juandopazo
  • GitHub: juandopazo
  • Gists: juandopazo
  • Offline
  • Profile

Re: YUI 3.5.0 Orientation Left/Right

Post Posted: Tue May 08, 2012 5:29 am
+0-
At first I thought you meant text orientation, but indeed, it's what Jeff said.

Here's an example: http://jsfiddle.net/Uky5G/

Dan Cowen

  • Username: hattersville
  • Joined: Mon May 07, 2012 8:16 am
  • Posts: 8
  • Offline
  • Profile

Re: YUI 3.5.0 Orientation Left/Right

Post Posted: Wed May 09, 2012 7:47 am
+0-
Thank you both so much! Your assistance has been invaluable!!!

Dan Cowen

  • Username: hattersville
  • Joined: Mon May 07, 2012 8:16 am
  • Posts: 8
  • Offline
  • Profile
Tags:

Re: YUI 3.5.0 Orientation Left/Right

Post Posted: Wed May 09, 2012 8:38 am
+0-
Juan,

Thanks for all your help with this.
Unfortunately, my JS, while functional, is weak.

You built this on the basis of the site and all its content being designed in JS, I need to have a primary focus in HTML and use JS as a tool.

Can you show me the result you shared with the script in the head and all the content in the body? I tried reverse engineering what you did to fit in my site, and it did not work.

Sorry to be a bother.

Dan

Jeff Pihach

YUI Contributor

  • Username: hatch
  • Joined: Wed Dec 08, 2010 9:20 am
  • Posts: 37
  • Twitter: fromanegg
  • GitHub: hatched
  • Gists: hatched
  • IRC: hatch
  • Offline
  • Profile
Tags:

Re: YUI 3.5.0 Orientation Left/Right

Post Posted: Wed May 09, 2012 9:08 am
+0-
So you want to progressively enhance your markup? See this example http://yuilibrary.com/yui/docs/tabview/#from-markup

Dan Cowen

  • Username: hattersville
  • Joined: Mon May 07, 2012 8:16 am
  • Posts: 8
  • Offline
  • Profile
Tags:

Re: YUI 3.5.0 Orientation Left/Right

Post Posted: Wed May 09, 2012 9:17 am
+0-
Yes, the link above is where I pulled the original code from. Unfortunately, I cannot get it to shift the tabs from the top of the page to the left side.

Juan accomplished the desired effect I wanted, but unfortunately I'm just not good enough at Javascript to design my entire site in Javascript, which his code forces me to do.

I'm trying to figure out how to accomplish this:

http://jsfiddle.net/Uky5G/

With the script in the head, and the html in the body.

I hope I'm communicating clearly, I'm still learning the proper verbiage.

Dan

Jeff Pihach

YUI Contributor

  • Username: hatch
  • Joined: Wed Dec 08, 2010 9:20 am
  • Posts: 37
  • Twitter: fromanegg
  • GitHub: hatched
  • Gists: hatched
  • IRC: hatch
  • Offline
  • Profile

Re: YUI 3.5.0 Orientation Left/Right

Post Posted: Wed May 09, 2012 9:29 am
+0-
You just use the srcNode property like in the example instead of supplying the content object.

here: http://jsfiddle.net/Uky5G/2/

Juan Ignacio Dopazo

YUI Contributor

  • Username: jdopazo
  • Joined: Fri Oct 02, 2009 5:39 am
  • Posts: 620
  • Location: Buenos Aires, Argentina
  • Twitter: juandopazo
  • GitHub: juandopazo
  • Gists: juandopazo
  • Offline
  • Profile
Tags:

Re: YUI 3.5.0 Orientation Left/Right

Post Posted: Wed May 09, 2012 9:29 am
+0-
Sorry, it's confusing because I had to tell YUI to load its stylesheets before my CSS changes and that's not straightforward to do in JSFiddle. But there was nothing I did in JavaScript that had to do with the positioning of the tabs. Only my CSS rules did that.

Here's the CSS that matters. There are still tweaks to be made for it to work right in IE, so take it as inspiration, not as a finished product.
Code:
.yui3-skin-sam .yui3-tabview-list {
    float: left;
    border: none;
    width: 100px;
}
.yui3-skin-sam .yui3-tabview-panel {
    border-left: 5px solid #2647A0;
    margin-left: 100px;
    min-height: 200px;
}
.yui3-skin-sam .yui3-tab {
    margin-right: 0;
}
.yui3-skin-sam .yui3-tab,
.yui3-skin-sam .yui3-tab-content {
    display: block;
}

Dan Cowen

  • Username: hattersville
  • Joined: Mon May 07, 2012 8:16 am
  • Posts: 8
  • Offline
  • Profile

Re: YUI 3.5.0 Orientation Left/Right

Post Posted: Wed May 09, 2012 9:38 am
+0-
Thank you both! You guys are awesome!

I really appreciate all your help with this.

Dan
  [ 10 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum