javascript - Microsoft styled tabs -
recently asked question on stackoverflow multiline tabs. below link
i wondering if possible make them windows styled tabs, if tab in first line selected, want push second line. problem have creating dynamic tabs. possible using javascript/jquery, calculate widths of each tab , determine @ point second line of tabs started?
thanks
updated added tab auto-resize.
tested on chrome
/ ff
- demo & source: http://ask.altervista.org/demo/microsoft-styled-tabs/
$(function() { setlines(); $('#windows-properties li a').click(function(e) { e.preventdefault(); var $li = $(this).parent(); $(this.hash).show().siblings('.property-content').hide(); var litp = parseint($li.position().top); if (litp < lastlipos) { $('li.line-' + litp).wrapall('<div id="move-lis"></div>'); $('#move-lis').insertafter('#windows-properties li:last'); $('li.line-' + litp).unwrap(); setlines(); } $li.addclass('selected').siblings('li').removeclass('selected'); }); var $lstli = $('#windows-properties li:last'); var lastlipos = parseint($lstli.addclass('selected').position().top); $('.property-content:last').show(); }); //.... other part of code in demo source ...
Comments
Post a Comment