R
R
rsoinvi2015-10-08 16:13:59
JavaScript
rsoinvi, 2015-10-08 16:13:59

How can I make the page open once?

Here is the code. It opens several windows on mouse action.

I understand that it will open as many windows as there will be certain actions. Tell me how can I make it open only once on click

$('div').each(function() {
$(this).on('mouseover mouseout', function(){
$('#Stage_Bt_1'). css({zIndex:"999", cursor:"pointer"});
$('#Stage_Bt_1').click(function() {
window.open(" www.w3schools.com ");
});;
}) ;
})

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2015-10-08
@rsoinvi

$('div').each(function() {
  $(this).on('mouseover mouseout', function(){
    $('#Stage_Bt_1').css({zIndex:"999", cursor:"pointer"});     
    $('#Stage_Bt_1').unbind().on('click', function() {
      window.open("www.w3schools.com");
    });
  });
})

E
Evgeny Petrov, 2015-10-08
@EvgenZZ

$('#Stage_Bt_1').click(function(e) {
e.preventDefault();
window.open("www.w3schools.com");
});;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question