This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

jQuery Toggle Problem

By: a guest on May 13th, 2011  |  syntax: HTML  |  size: 13.63 KB  |  views: 32  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head><title>
  6.        
  7. </title>
  8.         <!-- iPhone, iPad and Android specific settings -->
  9.         <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1;" />
  10.         <meta name="apple-mobile-web-app-capable" content="yes" />
  11.         <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
  12.         <!-- Create an icon and splash screen for iPhone and iPad -->
  13.         <link rel="apple-touch-icon" href="images/iOS_icon.png" />
  14.         <link rel="apple-touch-startup-image" href="images/iOS_startup.png" />
  15.         <link rel="stylesheet" type="text/css" href="css/all.css" media="screen" />
  16.         <!-- These stylesheets are used  -->
  17.         <link href="css/theme/theme_blue.css" rel="stylesheet" type="text/css" />
  18.         <link href="css/layout_fixed.css" rel="stylesheet" type="text/css" />
  19.         <link href="css/theme/bg_noise.css" rel="stylesheet" type="text/css" />
  20.         <!--[if IE 6]><link rel="stylesheet" type="text/css" href="css/ie6.css" media="screen" /><![endif]-->
  21.         <!--[if IE 7]><link rel="stylesheet" type="text/css" href="css/ie.css" media="screen" /><![endif]-->
  22.         <!-- Load JQuery -->
  23.         <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  24.         <!-- Load JQuery UI -->
  25.         <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  26.         <!-- Load Interface Plugins -->
  27.         <script type="text/javascript" src="js/plugins.js"></script>
  28.         <script type="text/javascript" src="js/fancybox/jquery.fancybox-1.3.4.js"></script>
  29.         <script type="text/javascript" src="js/quicksand/jquery.quicksand.js"></script>
  30.         <script type="text/javascript" src="js/quicksand/custom_sorter.js"></script>
  31.         <script type="text/javascript" src="js/quicksand/jquery-css-transform.js"></script>
  32.         <script type="text/javascript" src="js/quicksand/jquery-animate-css-rotate-scale.js"></script>
  33.         <script type="text/javascript" src="js/tinyeditor/tinyeditor.js"></script>
  34.         <script type="text/javascript" src="js/DataTables/jquery.dataTables.js"></script>
  35.         <script type="text/javascript" src="js/jqueryFileTree/jqueryFileTree.js"></script>
  36.         <script type="text/javascript" src="js/fullcalendar/fullcalendar.min.js"></script>
  37.         <script type='text/javascript' src='js/fullcalendar/gcal.js'></script>
  38.         <script type='text/javascript' src='js/flot/jquery.flot.js'></script>
  39.         <script type='text/javascript' src='js/flot/jquery.flot.resize.js'></script>
  40.         <script type='text/javascript' src='js/flot/jquery.flot.pie.js'></script>
  41.         <!-- This file configures the various jQuery plugins for Adminica. Contains links to help pages for each plugin. -->
  42.         <script type="text/javascript" src="js/adminica/adminica_ui.js"></script>
  43.     </head>
  44. <body>
  45.     <form method="post" action="" id="form1">
  46. <div class="aspNetHidden">
  47. <input type="hidden" name="viewStateGUIDkey" id="viewStateGUIDkey" value="16d7ea70-ecd9-40d0-821d-6c50480700e0" />
  48. <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
  49. <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
  50. <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE3NzAzNjExMjgPZBYCZg9kFgICAw9kFgYCAQ8PFgIeBFRleHQFBUFkbWluZGQCAw8PFgIfAAUKQWRtaW4gVXNlcmRkAgcPZBYEAgEPDxYCHwBlZGQCAg88KwARAgAPFgQeC18hRGF0YUJvdW5kZx4LXyFJdGVtQ291bnQCIGQMFCsABBYIHgROYW1lBQh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A4MzIgMDAwMGRkAgMPDxYCHwAFDm1haWx0bzphQGIuY29tZGQCBw9kFghmDw8WAh8ABQIxMGRkAgEPDxYCHwAFJEJydW50d29vZCAyMDAwIEZvdXJ0aCBQcm9wZXJ0aWVzIEx0ZGRkAgIPDxYCHwAFDTAxNjEgODMyIDAwMDBkZAIDDw8WAh8ABQ5tYWlsdG86YUBiLmNvbWRkAggPZBYIZg8PFgIfAAUCMTFkZAIBDw8WAh8ABSRCcnVudHdvb2QgMjAwMCBGb3VydGggUHJvcGVydGllcyBMdGRkZAICDw8WAh8ABQ0wMTYxIDgzMiAwMDAwZGQCAw8PFgIfAAUObWFpbHRvOmFAYi5jb21kZAIJD2QWCGYPDxYCHwAFAjEyZGQCAQ8PFgIfAAUkQnJ1bnR3b29kIDIwMDAgRm91cnRoIFByb3BlcnRpZXMgTHRkZGQCAg8PFgIfAAUNMDE2MSA4MzIgMDAwMGRkAgMPDxYCHwAFDm1haWx0bzphQGIuY29tZGQCCg9kFghmDw8WAh8ABQIxM2RkAgEPDxYCHwAFJEJydW50d29vZCAyMDAwIEZvdXJ0aCBQcm9wZXJ0aWVzIEx0ZGRkAgIPDxYCHwAFDTAxNjEgODMyIDAwMDBkZAIDDw8WAh8ABQ5tYWlsdG86YUBiLmNvbWRkAgsPDxYCHgdWaXNpYmxlaGRkGAEFI2N0bDAwJENvbnRlbnRQbGFjZUhvbGRlcjEkZ3ZDbGllbnRzDzwrAAwBCAIEZPYA64yn04fiT3OJ/Ls0VTn/viTVUAedXikolmxOHJO/" />
  51. </div>
  52.  
  53. <script type="text/javascript">
  54. //<![CDATA[
  55. var theForm = document.forms['form1'];
  56. if (!theForm) {
  57.    theForm = document.form1;
  58. }
  59. function __doPostBack(eventTarget, eventArgument) {
  60.    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
  61.        theForm.__EVENTTARGET.value = eventTarget;
  62.        theForm.__EVENTARGUMENT.value = eventArgument;
  63.        theForm.submit();
  64.    }
  65. }
  66. //]]>
  67. </script>
  68.  
  69.  
  70. <script src="/WebResource.axd?d=rR_iszgdfCzr6ikNjy9Fni5Ii1uPEy8Z6LAGCDLFmav-PrrUHJJhn_U7Hudw00Qe7uK--SeywC9o8NDfMQh21rwgo0tIN100VbFTzD1T4mg1&amp;t=634362988170717995" type="text/javascript"></script>
  71.  
  72. <div class="aspNetHidden">
  73.  
  74.         <input type="hidden" name="__SCROLLPOSITIONX" id="__SCROLLPOSITIONX" value="0" />
  75.         <input type="hidden" name="__SCROLLPOSITIONY" id="__SCROLLPOSITIONY" value="0" />
  76.         <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBQLjsM6tAQLN1J/gDgKDuqj2DAKDutT2DAKDusD2DHvJdwagLIEDzjLzPSppn2s//yNopPwYOofYZi0x1rup" />
  77. </div>
  78.     <div>
  79.         <div id="wrapper">
  80.             <div id="sidebar">
  81.                 <a href="/" class="logo"></a>
  82.                 <div class="user_box round_all clearfix">
  83.                     <img src="images/profile.jpg" width="55" alt="Profile Pic" />
  84.                     <h2><span id="lblUserPriv">Admin</span></h2>
  85.                     <h3><a class="text_shadow" href="#"><span id="lblFullname">Admin User</span></a></h3>
  86.                     <ul>
  87.                         <li><a href="#">settings</a><span class="divider">|</span></li>
  88.                         <li><a href="Logout.aspx">logout</a></li>
  89.                     </ul>
  90.                 </div>
  91.                 <!-- #user_box -->
  92.                 <ul id="accordion">
  93.                     <li><a href="#" class="top_level">
  94.                         <img src="images/icons/small/grey/home.png" />Home</a>
  95.                         <ul class="drawer">
  96.                             <li><a href="#">Activity</a></li>
  97.                             <li><a href="#">Events</a></li>
  98.                             <li><a href="#">Tasks</a></li>
  99.                         </ul>
  100.                     </li>
  101.                     <li><a href="#" class="top_level">
  102.                         <img src="images/icons/small/grey/Month_Calendar.png" />Appointments</a>
  103.                         <ul class="drawer">
  104.                             <li><a href="#">Diary</a></li>
  105.                             <li><a href="#">Book Appointment</a></li>
  106.                         </ul>
  107.                     </li>
  108.                     <li><a href="#" class="top_level">
  109.                         <img src="images/icons/small/grey/users.png" />Clients</a>
  110.                         <ul class="drawer">
  111.                             <li><a href="Clients.aspx">Add New</a></li>
  112.                             <li><a href="#">Edit/Delete</a></li>
  113.                             <li><a href="#">Search</a></li>
  114.                         </ul>
  115.                     </li>
  116.                     <li><a href="#" class="top_level">
  117.                         <img src="images/icons/small/grey/Under_Construction.png" />Jobs</a>
  118.                         <ul class="drawer">
  119.                             <li><a href="#">Create New</a></li>
  120.                             <li><a href="#">View All</a></li>
  121.                         </ul>
  122.                     </li>
  123.                     <li><a href="#" class="top_level">
  124.                         <img src="images/icons/small/grey/graph.png" />Reporting</a>
  125.                         <ul class="drawer">
  126.                             <li><a href="#">Reports</a></li>
  127.                             <li><a href="#">Graphs</a></li>
  128.                         </ul>
  129.                     </li>
  130.                     <li id="pnAdmin"><a href="#" class="top_level">
  131.                         <img src="images/icons/small/grey/cog%202.png" />Admin Settings</a>
  132.                         <ul class="drawer">
  133.                             <li><a href="#">Account</a></li>
  134.                             <li><a href="#">System</a></li>
  135.                         </ul>
  136.                     </li>
  137.                 </ul>
  138.                
  139.                 <ul id="side_links" class="text_shadow">
  140.                     <li><a href="#">
  141.                         <img src="images/icons/small/grey/Alert.png" alt="" />Report a Problem</a></li>
  142.                 </ul>
  143.             </div>
  144.             <!-- #sidebar -->
  145.            
  146. <script language="javascript" type="text/javascript">
  147. $(function () {
  148.             $("a.toggle").click(function () {
  149.                 $(this).toggleClass("toggle_closed").next().slideToggle("slow", function () {
  150.                     if($(this).is(':visible')){
  151.                     $('#ContentPlaceHolder1_hidAccordionIndex').val("1");
  152.                     }
  153.                     else{
  154.                     $('#ContentPlaceHolder1_hidAccordionIndex').val("0");
  155.                     }
  156.                 });
  157.                 return false; //Prevent the browser jump to the link anchor
  158.             });
  159.             var val = $('#ContentPlaceHolder1_hidAccordionIndex').val();
  160.             if (val == "1") {
  161.                 $("a.toggle").click();
  162.             }
  163.         });
  164. </script>
  165. <input type="hidden" name="ctl00$ContentPlaceHolder1$hidAccordionIndex" id="ContentPlaceHolder1_hidAccordionIndex" value="0" />
  166. <div id="main_container" class="main_container container_16 clearfix">
  167.         <div id="nav_top" class="clearfix  round_top">
  168.             <ul class="clearfix">
  169.                 <li class="current"><a href="/"><img src="images/icons/small/white/home.png" />Home</a></li>
  170.             </ul>
  171.         </div>
  172.         <!-- #nav_top -->
  173.         <div class="flat_area grid_16">
  174.                                         <h2>Welcome to the Waters H&P Job Management System</h2>
  175.                    <p>Click on the arrow's below to <strong>show/hide</strong> a category.</p>
  176.                                 </div>
  177.                                 <div class="box grid_16 round_all">
  178.                                         <h2 class="box_head grad_colour round_top">Client List</h2>    
  179.                                         <a href="#" class="toggle toggle_closed">&nbsp;</a>
  180.                                         <div class="toggle_container" style="display:none;">
  181.                                                 <span id="ContentPlaceHolder1_LBLMessage"></span>
  182.                                                                 <div>
  183.         <table class="static" cellspacing="0" rules="all" border="1" id="ContentPlaceHolder1_gvClients" style="border-collapse:collapse;">
  184.                 <thead>
  185.                         <tr>
  186.                                 <th scope="col">ClientID</th><th scope="col">ClientName</th><th scope="col">Tel</th><th scope="col">EmailLink</th>
  187.                         </tr>
  188.                 </thead><tbody>
  189.                         <tr>
  190.                                 <td>4</td><td>A</td><td>&nbsp;</td><td>mailto:</td>
  191.                         </tr><tr>
  192.                                 <td>5</td><td>B</td><td>&nbsp;</td><td>&nbsp;</td>
  193.                         </tr><tr>
  194.                                 <td>6</td><td>ABC Properties Ltd</td><td>1234 832 0000</td><td>mailto:a@b.com</td>
  195.                         </tr><tr>
  196.                                 <td>7</td><td>ABC Properties Ltd</td><td>1234 832 0000</td><td>mailto:a@b.com</td>
  197.                         </tr><tr>
  198.                                 <td>8</td><td>ABC Properties Ltd</td><td>1234 832 0000</td><td>mailto:a@b.com</td>
  199.                         </tr><tr>
  200.                                 <td>9</td><td>ABC Properties Ltd</td><td>1234 832 0000</td><td>mailto:a@b.com</td>
  201.                         </tr><tr>
  202.                                 <td>10</td><td>ABC Properties Ltd</td><td>1234 832 0000</td><td>mailto:a@b.com</td>
  203.                         </tr><tr>
  204.                                 <td>11</td><td>ABC Properties Ltd</td><td>1234 832 0000</td><td>mailto:a@b.com</td>
  205.                         </tr><tr>
  206.                                 <td>12</td><td>ABC Properties Ltd</td><td>1234 832 0000</td><td>mailto:a@b.com</td>
  207.                         </tr><tr>
  208.                                 <td>13</td><td>ABC Properties Ltd</td><td>1234 832 0000</td><td>mailto:a@b.com</td>
  209.                         </tr><tr>
  210.                                 <td colspan="4"><table>
  211.                                         <tr>
  212.                                                 <td><span>1</span></td><td><a href="javascript:__doPostBack(&#39;ctl00$ContentPlaceHolder1$gvClients&#39;,&#39;Page$2&#39;)">2</a></td><td><a href="javascript:__doPostBack(&#39;ctl00$ContentPlaceHolder1$gvClients&#39;,&#39;Page$3&#39;)">3</a></td><td><a href="javascript:__doPostBack(&#39;ctl00$ContentPlaceHolder1$gvClients&#39;,&#39;Page$4&#39;)">4</a></td>
  213.                                         </tr>
  214.                                 </table></td>
  215.                         </tr>
  216.                 </tbody>
  217.         </table>
  218. </div>
  219.                                         </div>
  220.                         </div>
  221.     </div>
  222.  
  223.            
  224.         </div>
  225.     </div>
  226.    
  227.  
  228. <script type="text/javascript">
  229. //<![CDATA[
  230.  
  231. theForm.oldSubmit = theForm.submit;
  232. theForm.submit = WebForm_SaveScrollPositionSubmit;
  233.  
  234. theForm.oldOnSubmit = theForm.onsubmit;
  235. theForm.onsubmit = WebForm_SaveScrollPositionOnSubmit;
  236. //]]>
  237. </script>
  238. </form>
  239. </body>
  240. </html>
clone this paste RAW Paste Data