BlackReef
07-17-2010, 03:33 AM
Hello,
I am building a shopping cart website that is using a mega javascript dropdown menu.
Everything was working fine until you get to the checkout page on the website. The checkout page has this accordian / spry deal where customers can checkout on one page. You can view it here:
http://gem-tech.com.mytempweb.com/store/pc/onepagecheckout.asp (http://gem-tech.com.mytempweb.com/store/pc/onepagecheckout.asp)
If I take the menu code out of the header.asp file, then the checkout page works just fine. But if I put the menu code back in, then the checkout page stops working.
Here is the menu code (simplified it a bit for this thread):
<head>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript" src="jquery.hoverIntent.minified.js"></script>
<script type="text/javascript">
$(document).ready(function() {
function megaHoverOver(){
$(this).find(".sub").stop().fadeTo('fast', 1).show();
//Calculate width of all ul's
(function($) {
jQuery.fn.calcSubWidth = function() {
rowWidth = 0;
//Calculate row
$(this).find("ul").each(function() {
rowWidth += $(this).width();
});
};
})(jQuery);
if ( $(this).find(".row").length > 0 ) { //If row exists...
var biggestRow = 0;
//Calculate each row
$(this).find(".row").each(function() {
$(this).calcSubWidth();
//Find biggest row
if(rowWidth > biggestRow) {
biggestRow = rowWidth;
}
});
//Set width
$(this).find(".sub").css({'width' :biggestRow});
$(this).find(".row:last").css({'margin':'0'});
} else { //If row does not exist...
$(this).calcSubWidth();
//Set Width
$(this).find(".sub").css({'width' : rowWidth});
}
}
function megaHoverOut(){
$(this).find(".sub").stop().fadeTo('fast', 0, function() {
$(this).hide();
});
}
var config = {
sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
interval: 100, // number = milliseconds for onMouseOver polling interval
over: megaHoverOver, // function = onMouseOver callback (REQUIRED)
timeout: 500, // number = milliseconds delay before onMouseOut
out: megaHoverOut // function = onMouseOut callback (REQUIRED)
};
$("ul#topnav li .sub").css({'opacity':'0'});
$("ul#topnav li").hoverIntent(config);
});
</script>
</body>
And there are two things of script on the onepagecheckout.asp page as well. Here they are:
<script type="text/javascript">
$(document).ready(function() { $('#chkPayment').click(); });
</script>
<script type="text/javascript">
var acc1 = new Spry.Widget.Accordion("acc1", { useFixedPanelHeights: false, enableAnimation: false });
var currentPanel = 0;
<% if session("idCustomer")>"0" then
session("OPCstep")=2
else
session("OPCstep")=0
end if %>
//* Find Current Panel
<% if len(Session("CurrentPanel"))=0 AND pcv_strPayPanel="" then %>
<% if session("idCustomer")>"0" then %>
acc1.openPanel('opcLogin');
GoToAnchor('opcLoginAnchor');
$('#LoginOptions').hide();
$('#ShippingArea').hide();
$('#BillingArea').show();
<% else %>
$('#LoginOptions').show();
$('#acc1').hide();
<% end if %>
<% else %>
<% If pcv_strPayPanel = "1" Then %>
$(document).ready(function() {
$('#LoginOptions').hide();
pcf_LoadPaymentPanel();
});
<% Else %>
acc1.openPanel('opcLogin');
$('#LoginOptions').hide();
$('#ShippingArea').hide();
$('#BillingArea').show();
<% End If %>
<% end if %>
GoToAnchor('opcLoginAnchor');
function openme(pNumber) {
acc1.openPanel(pNumber);
}
function toggle(pNumber) {
var ele = acc1.getCurrentPanel();
var panelNumber = acc1.getPanelIndex(ele);
if (panelNumber == pNumber) {
acc1.closePanel(pNumber);
} else {
acc1.openPanel(pNumber);
}
}
function togglediv(id) {
var div = document.getElementById(id);
if(div.style.display == 'block')
div.style.display = 'none';
else
div.style.display = 'block';
}
function win(fileName)
{
myFloater=window.open('','myWindow','scrollbars=yes,status=no,width=300,height=250')
myFloater.location.href=fileName;
}
</script>
Any help would be GREATLY appreciated,
Thank you
I am building a shopping cart website that is using a mega javascript dropdown menu.
Everything was working fine until you get to the checkout page on the website. The checkout page has this accordian / spry deal where customers can checkout on one page. You can view it here:
http://gem-tech.com.mytempweb.com/store/pc/onepagecheckout.asp (http://gem-tech.com.mytempweb.com/store/pc/onepagecheckout.asp)
If I take the menu code out of the header.asp file, then the checkout page works just fine. But if I put the menu code back in, then the checkout page stops working.
Here is the menu code (simplified it a bit for this thread):
<head>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript" src="jquery.hoverIntent.minified.js"></script>
<script type="text/javascript">
$(document).ready(function() {
function megaHoverOver(){
$(this).find(".sub").stop().fadeTo('fast', 1).show();
//Calculate width of all ul's
(function($) {
jQuery.fn.calcSubWidth = function() {
rowWidth = 0;
//Calculate row
$(this).find("ul").each(function() {
rowWidth += $(this).width();
});
};
})(jQuery);
if ( $(this).find(".row").length > 0 ) { //If row exists...
var biggestRow = 0;
//Calculate each row
$(this).find(".row").each(function() {
$(this).calcSubWidth();
//Find biggest row
if(rowWidth > biggestRow) {
biggestRow = rowWidth;
}
});
//Set width
$(this).find(".sub").css({'width' :biggestRow});
$(this).find(".row:last").css({'margin':'0'});
} else { //If row does not exist...
$(this).calcSubWidth();
//Set Width
$(this).find(".sub").css({'width' : rowWidth});
}
}
function megaHoverOut(){
$(this).find(".sub").stop().fadeTo('fast', 0, function() {
$(this).hide();
});
}
var config = {
sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
interval: 100, // number = milliseconds for onMouseOver polling interval
over: megaHoverOver, // function = onMouseOver callback (REQUIRED)
timeout: 500, // number = milliseconds delay before onMouseOut
out: megaHoverOut // function = onMouseOut callback (REQUIRED)
};
$("ul#topnav li .sub").css({'opacity':'0'});
$("ul#topnav li").hoverIntent(config);
});
</script>
</body>
And there are two things of script on the onepagecheckout.asp page as well. Here they are:
<script type="text/javascript">
$(document).ready(function() { $('#chkPayment').click(); });
</script>
<script type="text/javascript">
var acc1 = new Spry.Widget.Accordion("acc1", { useFixedPanelHeights: false, enableAnimation: false });
var currentPanel = 0;
<% if session("idCustomer")>"0" then
session("OPCstep")=2
else
session("OPCstep")=0
end if %>
//* Find Current Panel
<% if len(Session("CurrentPanel"))=0 AND pcv_strPayPanel="" then %>
<% if session("idCustomer")>"0" then %>
acc1.openPanel('opcLogin');
GoToAnchor('opcLoginAnchor');
$('#LoginOptions').hide();
$('#ShippingArea').hide();
$('#BillingArea').show();
<% else %>
$('#LoginOptions').show();
$('#acc1').hide();
<% end if %>
<% else %>
<% If pcv_strPayPanel = "1" Then %>
$(document).ready(function() {
$('#LoginOptions').hide();
pcf_LoadPaymentPanel();
});
<% Else %>
acc1.openPanel('opcLogin');
$('#LoginOptions').hide();
$('#ShippingArea').hide();
$('#BillingArea').show();
<% End If %>
<% end if %>
GoToAnchor('opcLoginAnchor');
function openme(pNumber) {
acc1.openPanel(pNumber);
}
function toggle(pNumber) {
var ele = acc1.getCurrentPanel();
var panelNumber = acc1.getPanelIndex(ele);
if (panelNumber == pNumber) {
acc1.closePanel(pNumber);
} else {
acc1.openPanel(pNumber);
}
}
function togglediv(id) {
var div = document.getElementById(id);
if(div.style.display == 'block')
div.style.display = 'none';
else
div.style.display = 'block';
}
function win(fileName)
{
myFloater=window.open('','myWindow','scrollbars=yes,status=no,width=300,height=250')
myFloater.location.href=fileName;
}
</script>
Any help would be GREATLY appreciated,
Thank you