Jquery sekmeleri ile Yardım

0 Cevap php

Ben varsayılan sekme olmayan bir sekme içinde olan içeriği (farklı bir sayfada düzenli bir href çapa ile) bağlamak için bilmek gerekir. Bu yapılabilir mi? Benim kod gerektirecek ne umarım açıklayacağız:

Benim Kod:

The following is my profile_edit.php page:

Javascript:

<script src="Javascript/jquery-1.4.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
 $(function () {
 var tabContainers = $('div.tabs > div');
 tabContainers.hide().filter(':first').show();

 $('div.tabs ul.tabNavigation a').click(function () {
   tabContainers.hide();
   tabContainers.filter(this.hash).show();
   $('div.tabs ul.tabNavigation a').removeClass('selected');
   $(this).addClass('selected');
   return false;
 }).filter(':first').click();
 }); 
 $(function () {
    var tabs = [];
    var tabContainers = [];
    $('ul.tabs a').each(function () {
      // note that this only compares the pathname, not the entire url
      // which actually may be required for a more terse solution.
        if (this.pathname == window.location.pathname) {
            tabs.push(this);
            tabContainers.push($(this.hash).get(0));
        }
    });

    // sniff for hash in url, and create filter search 
    var selected = window.location.hash ? '[hash=' + window.location.hash + ']' : ':first'; 

    $(tabs).click(function () {
        // hide all tabs
        $(tabContainers).hide().filter(this.hash).show();

        // set up the selected class
        $(tabs).removeClass('selected');
        $(this).addClass('selected');

        return false;
    }).filter(selected).click();
});
</script>

Html ve PHP (bir bölümü):

<div class="tabs">
  <ul class="tabNavigation">
     <li><a href="#account_div">Account</a></li>
     <li><a href="#change_password_div">Password</a></li>
     <li><a href="#favorites_div">Favorites</a></li>
     <li><a href="#avatar_div">Avatar</a></li>
  </ul> 
  <div id="account_div">
     <?php include("personal_info_edit.php"); ?> 
     </div>
     <div id="change_password_div">
     <?php include("change_password.php"); ?> 
     </div>
     <div id="favorites_div">
     <?php include("favorites.php"); ?> 
     </div> 
     <div id="avatar_div">
     <?php include("avatar.php"); ?> 
     </div>
   </div>

Aşağıdaki benim change_password_submit.php sayfasında bulunan:

$update_pass= ("Password changed successfully.");
header("location:profile_edit.php?update_pass=$update_pass#change_password_div"); 
exit();

By default, whenever profile_edit.php is loaded, the personal_info_edit div is shown and the others are hidden. What do I need to change in the code so that I can reference the 2nd div (ie. change_password div and hide the rest after someone changes their password? Any help will be greatly appreciated.

0 Cevap