2014-02-07 20 views
0

我想在用戶點擊「a href」或「ajax圖像加載之前」時意味着用戶不會點擊的「按鈕」時顯示塊圖像另一個按鈕直到該頁面加載。顯示一個塊更改頁面前的圖像

我試過這個代碼,但它不工作我」,我是jQuery的新的,如果somenone可以與幫助,我會graetful

<?php if($this->uri->segment(1) != 'pedidos'){ ?> 

$(document).ready(function(){ 
    $('a, button').click(function(event){ 
     $('#bloqueio_tela').show(); 
     event.stopPropagation(); 
    }); 
}); 

回答

0

使用event.preventDefault()

$(document).ready(function(){ 
    $('a, button').click(function(event){ 
     event.preventDefault(); 
     $('#bloqueio_tela').show(); 
    }); 
}); 

它確實聽起來像!防止默認事件!

相關問題