Guest User

Untitled

a guest
Jun 14th, 2012
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. Prevent an exception with jQuery UI Tabs
  2. $("#tabs").tabs("add","#tabContent0","CLICK ME TO CHANGE PAGE",0);
  3. $('a[href="#tabContent0"]').attr("href","javascript:window.location='http://www.google.co.uk';");
  4.  
  5. $('#tabs').bind('tabsselect', function(event, ui) {
  6.  
  7. if(ui.index<2) //ignore this will change to get current tab count -1 (so the end tab is left as it is
  8. {
  9. window.location=$('#'+ui.tab).attr("href"); //attr href is undefined, how do i use ui.tab properly to get the right url
  10. return false;
  11. }
  12.  
  13. });
  14.  
  15. $("#tabs").tabs("add","#tabContent0","CLICK ME TO CHANGE PAGE",0);
  16. $('a[href="#tabContent0"]').click(function() {
  17. document.location='http://www.google.co.uk/';
  18. });
  19.  
  20. $('#example').tabs({
  21. select: function(event, ui) {
  22. var url = $.data(ui.tab, 'load.tabs');
  23. if( url ) {
  24. location.href = url;
  25. return false;
  26. }
  27. return true;
  28. }
  29. });
Advertisement
Add Comment
Please, Sign In to add comment