I am trying to use the elevate-zoom plugin in jquery tabs. It works fine in the first tab, but breaks when changing tabs. I understand what is happening, but don't know how to solve it. If I change the class it takes a second click for the .hide to take effect. I'm a rookie to jquery, any help would be appreciated. This is the first time I've posted code, I hope it's correct.
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.0.js"</script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="Scripts/jquery.elevatezoom.js"></script>
<link type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/black-tie/jquery-ui.css" rel="stylesheet" />
<style type="text/css">
.hide { position: absolute; top: -9999px; left: -9999px; }
</style>
</head>
<body>
<div id="wrapper" style="min-height: 520px;">
<div id="tabs" style="margin: 0px 10px 10px 10px; min-height: 460px; font-size: 9pt;">
<ul>
<li><a href="#fragment-1"><span><b>First Panel</b></span></a></li>
<li><a href="#fragment-2"><span>Second Panel</span></a></li>
</ul>
<div id="fragment-1" class="first">
<div id='Div1' style='margin-left: 60px;'>
<img id="zoom_01" src='http://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Austin_Healey_3000_red_vl.jpg/800px-Austin_Healey_3000_red_vl.jpg' width="300" data-zoom-image="http://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Austin_Healey_3000_red_vl.jpg/800px-Austin_Healey_3000_red_vl.jpg"/>
</div>
</div>
<div id="fragment-2">
<div id='Div2' style='margin-left: 60px;'>
<img id="no_zoom" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Austin-Healey_3000_at_2010_Ottawa_British_Auto_Show.jpg/800px-Austin-Healey_3000_at_2010_Ottawa_British_Auto_Show.jpg" />
</div>
</div>
</div>
</div>
<script type="text/javascript">
$("#tabs").tabs({ show: { effect: "blind", duration: 500} });
jQuery(document).ready(function () {
$("#accordion").accordion({ active: 0 });
$("#zoom_01").elevateZoom({
zoomWindowWidth: 300,
zoomWindowHeight: 300,
scrollZoom: true,
easing: true,
zoomWindowFadeIn: 500,
zoomWindowFadeOut: 500,
lensFadeIn: 500,
lensFadeOut: 500,
zoomWindowPosition: 1,
zoomWindowOffetx: 10
});
});
$('#tabs').click('tabsselect', function (event, ui) {
event.preventDefault();
if ($("#tabs").tabs('option', 'active') > 0)
$(".first").addClass("hide")
else
$(".first").removeClass("hide")
});
</script>
</body>
</html>