cookies within tabs takes me back to the first tab.
in Using jQuery UI
•
11 years ago
I have a product in tabs and I have a logo upload option on the 3rd tab. When you upload a logo and hit submit, it automatically puts the tab view back at tab 1, instead of staying on tab 3. My boss said that the cookie portion of code below, that is in red, is how he got this to work correctly last year but it's not working correctly now. We just discovered today that it's not working on some live products. 
Can anyone help out with this please?
thank you,
Greg
<script type="text/javascript" src="https://www.google.com/jsapi?key=ABQIAAAAIXcsZDZM8dc9g6EK0adVlxSW_scAHDeRiINWfGMFC5jYEyWcMxShtNw19fJs_zq_rjo1yE61EH4tqg"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/smoothness/jquery-ui.css" type="text/css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery.ui.widget.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery.ui.tabs.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery.cookie.js"></script>
<meta charset="utf-8">
<script>
$(function() {
var $tabs = $('#tabs').tabs();
$(".ui-tabs-panel").each(function(i){
var totalSize = $(".ui-tabs-panel").size() - 1;
if (i != 0) {
prev = i;
$(this).append("<a href='#' class='prev-tab mover' style='mover' rel='" + prev + "'>« Prev Tab</a>");
}
if (i != 0 && i != totalSize) { $(this).append(" ");}
if (i != totalSize) {
next = i + 2;
$(this).append("<a href='#' class='next-tab mover' style='mover' rel='" + next + "'>Next Tab »</a>");
}
});
$('.next-tab, .prev-tab').click(function() {
$tabs.tabs('select', $(this).attr("rel"));
return false;
});
});
</script>
<!--NOT INCLUDED IN THE CODE
<script>
$(function() {
$( "#tabs" ).tabs({
cookie: {
// store cookie for a day, without, it would be a session cookie
expires: 1
}
});
});
</script>
-->
<div class="demo">
<div id="tabs">
<ul>
<li><a href="#tabs-1">Product<br>Description</a></li>
<li><a href="#tabs-2"><strong>Step 1:</strong><br>
Color Options</a></li>
<li><a href="#tabs-3"><strong>Step 2:</strong><br>Imprint Text</a></li>
<li><a href="#tabs-4"><strong>Step 3:</strong><br>Logos</a></li>
<li><a href="#tabs-5"><strong>Step 4:</strong><br>Approval</a></li>
</ul>
1