2014-02-17 93 views
0

我有以下jQuery功能:隱藏的DIV重定向

$("#member-allready").click(function(){ 
    SetCookie("subscribed","1"); 
    header("Location: http://www.google.co.uk/"); 
    return false; 
}); 

取而代之的是頭部的重定向header("Location: http://www.google.co.uk/");
我想隱藏一些div來代替。 e.g #div1, #div2, #div3 {display: none;}

這可能嗎?

+1

這是一個PHP的問題或一個jQuery的問題嗎? – Itay

+1

不是'header(「Location:http://www.google.co.uk/」);'是用於在PHP中重定向? –

+0

我猜想,PHP和jQuery。 是頭重定向,但想改變這個隱藏div – Scott

回答

1

$("#member-allready").click(function(){ 
      SetCookie("subscribed","1");  
      $('#div1').hide(); 
      return false; 
     }); 
+0

謝謝,這正是我需要的。 – Scott

0

您可以使用隱藏在jQuery的使用jQuery的this

$("#div1").hide() 
+0

謝謝,這工作。 – Scott