Я тут пытаюсь изменить модуль «VirtueMart 2 Slide Cart»>, но очень плохо знаком с javascript.
Необходимо следующее — задать условие при котором всплывающее окно не будет показываться при наведении на модуль.
Само условие, это когда в корзине нет никаких товаров.
Свой сайт я пока не выместил, но если что, то вот демо самого модуля
www.linelab.org/virtuemart-templates/?template=shoplab
default.php<?php<br>
/*<br>
* Created on Feb 23, 2012<br>
*<br>
* Author: Linelab.org<br>
* Project: mod_vmcart_j25<br>
*/<br>
<br>
defined('_JEXEC') or die('Restricted access');<br>
<br>
?><br>
<script type="text/javascript"><br>
window.addEvent('domready',function() {<br>
document.id('vmCartModule').addEvent('mouseover',function() {<br>
document.id('product_list').addClass('show_products');<br>
});<br>
document.id('vmCartModule').addEvent('mouseout',function() {<br>
document.id('product_list').removeClass('show_products');<br>
});<br>
document.id('product_list').addEvent('mouseover',function() {<br>
document.id('product_list').addClass('show_products');<br>
});<br>
document.id('product_list').addEvent('mouseout',function() {<br>
document.id('product_list').removeClass('show_products');<br>
});<br>
document.id('vmCartModule').addEvent('click',function() {<br>
document.id('product_list').addClass('show_products');<br>
(function(){document.id('product_list').removeClass('show_products')}).delay(15000);<br>
window.location.pathname='shop/cart';<br>
});<br>
document.id('product_list').addEvent('click',function() {<br>
document.id('product_list').addClass('show_products');<br>
(function(){document.id('product_list').removeClass('show_products')}).delay(15000);<br>
window.location.pathname='shop/cart';<br>
});<br>
<?php<br>
if(JRequest::getCmd('view')=='productdetails') {<br>
<br>
}<br>
?><br>
});<br>
<br>
function remove_product_cart(elm) {<br>
var cart_id=elm.getChildren('span').get('text');<br>
if(document.id('is_opc')) {<br>
remove_product(elm.getChildren('span').get('text'));<br>
} else {<br>
new Request.HTML({<br>
'url':'index.php?option=com_virtuemart&view=cart&task=delete',<br>
'method':'post',<br>
'data':'cart_virtuemart_product_id='+cart_id,<br>
'evalScripts':false,<br>
'onSuccess':function(tree,elms,html,js) {<br>
//jQuery(".vmCartModule").productUpdate();<br>
mod=jQuery(".vmCartModule");<br>
jQuery.getJSON(vmSiteurl+"index.php?option=com_virtuemart&nosef=1&view=cart&task=viewJS&format=json"+vmLang,<br>
function(datas, textStatus) {<br>
if (datas.totalProduct >0) {<br>
mod.find(".vm_cart_products").html("");<br>
jQuery.each(datas.products, function(key, val) {<br>
jQuery("#hiddencontainer .container").clone().appendTo(".vmCartModule .vm_cart_products");<br>
jQuery.each(val, function(key, val) {<br>
if (jQuery("#hiddencontainer .container ."+key)) mod.find(".vm_cart_products ."+key+":last").html(val) ;<br>
});<br>
});<br>
mod.find(".total").html(datas.billTotal);<br>
mod.find(".show_cart").html(datas.cart_show);<br>
} else {<br>
mod.find(".vm_cart_products").html("");<br>
mod.find(".show_cart").html("");<br>
mod.find(".total").html("Cart empty");<br>
//mod.find(".total").html(datas.billTotal);<br>
}<br>
mod.find(".total_products").html(datas.totalProductTxt);<br>
}<br>
);<br>
}<br>
}).send();<br>
}<br>
}<br>
</script><br>
<style type="text/css"><br>
.show_products{<br>
display:block !important;<br>
position: absolute;<br>
z-index: 100000;<br>
background: url("/modules/mod_vm2cart/cartpop.png") no-repeat left top transparent;<br>
width: <?php echo $params->def('width',150); ?>px;<br>
min-height: 20px;<br>
}<br>
.vm_cart_products{<br>
background: url("/modules/mod_vm2cart/bgc.png") repeat-y left top transparent;<br>
margin-top: 20px;<br>
width: 336px;<br>
font-size: 90%;<br>
padding-left: 15px;<br>
text-align: left;<br>
}<br>
#vmCartModule{<br>
cursor: pointer; <br>
float: right;<br>
width: <?php echo $params->def('width',150); ?>px;<br>
}<br>
#vmCartModule .show_products{<br>
right:25px;<br>
width:336px;<br>
}<br>
<br>
#vmCartModule .total, #vmCartModule .image {<br>
float:center;<br>
}<br>
#vmCartModule .container{ <br>
width:300px; <br>
}<br>
#vmCartModule .product_row {<br>
min-height: 70px;<br>
text-align: left; <br>
width:336px; <br>
}<br>
#vmCartModule .image img {<br>
border: 1px solid #ccc;<br>
text-align:center;<br>
height:60px; <br>
box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);<br>
}<br>
#vmCartModule .prices {<br>
float: right;<br>
padding: 0 10px;<br>
color: #000; <br>
}<br>
<br>
#vmCartModule .show_cart{<br>
background: url("/modules/mod_vm2cart/botct.png") no-repeat left top transparent;<br>
border-top: 0 none;<br>
font-size: 13px;<br>
padding-right: 10px;<br>
width: 336px;<br>
height:52px;<br>
}<br>
#vmCartModule .show_cart a {<br>
float: left;<br>
padding-left: 36px;<br>
padding-top: 11px;<br>
line-height:normal;<br>
}<br>
#vmCartModule a:hover {<br>
color: #000; <br>
}<br>
#vmCartModule .floatright{<br>
text-align:center !important;<br>
float:none;<br>
}<br>
</style><br>
<br>
<div class="vmCartModule" id="vmCartModule"><br>
<div class="total" style="display:inline;" id="total"><br>
<?php echo count($data->products)?($lang->_('COM_VIRTUEMART_CART_TOTAL').' : <strong>'. $data->billTotal.'</strong>'):Jtext::_('MOD_VM2_CART_CART_EMPTY'); ?><br>
</div><br>
<div style="clear:both"></div><br>
<div id="hiddencontainer" style="display:none"><br>
<div class="container"><br>
<!-- Image line --><br>
<div class="image"></div><br>
<div class="prices" style="display:inline;"></div><br>
<div class="product_row"><br>
<span class="product_name"></span><br /><br>
<span class="product_cart_id" style="display:none;"></span><br>
</div><br>
<div class="product_attributes"></div><br>
</div><br>
</div><br>
<div id="product_list" style="display:none;"><br>
<div class="vm_cart_products" id="vm_cart_products"><br>
<div class="container"><br>
<?php<br>
foreach($data->products as $product) {<br>
?><br>
<!-- Image line --><br>
<div class="image"><?php echo $product["image"]; ?></div><br>
<div class="prices" style="display:inline;"><?php echo $product["prices"]; ?></div><br>
<div class="product_row"><br>
<span class="product_name"><?php echo $product["product_name"]; ?></span><br /><br>
<span class="product_cart_id" style="display:none;"><?php echo $product["product_cart_id"]; ?></span><br>
</div><br>
<?php<br>
if(!empty($product["product_attributes"])) {<br>
?><br>
<div class="product_attributes"><?php echo $product["product_attributes"]; ?></div><br>
<?php<br>
}<br>
?><br>
<?php<br>
}<br>
?><br>
</div><div style="clear:both;"></div><br>
</div><br>
</div><br>
<div style="display:none"><br>
<div class="total_products"></div><br>
</div><br>
<input type="hidden" id="extra_cart" value="1" /><br>
</div>
Заранее благодарен.