473,626 Members | 3,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to call single javascript function for different <div> tags?

40 New Member
I`v made the following code:
Expand|Select|Wrap|Line Numbers
  1. <div id="Panels" style="width: 28%;"> 
  2.             <asp:Panel ID="one" runat="server" CssClass="Panel"> 
  3.                 <div id="Head" onclick="doToggle();"> 
  4.                     HEADER 
  5.                 </div> 
  6.             </asp:Panel> 
  7.             <asp:Panel ID="two" runat="server" CssClass="Content"> 
  8.                     abcdefghijklmnopqrstuvwxyz 
  9.            </asp:Panel> 
  10.             <cc1:CollapsiblePanelExtender ID="cpe" runat="server"  TargetControlID="two"></cc1:CollapsiblePanelExtender> 
  11. </div> 
  12.  
and the function doToggle() is:
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript"> 
  2.         function doToggle() 
  3.         { 
  4.             var cpe = $find("cpe"); 
  5.  
  6.             if (cpe.get_Collapsed())  
  7.             {    
  8.                 cpe._doOpen(); 
  9.             }  
  10.             else 
  11.             { 
  12.                 cpe._doClose(); 
  13.             } 
  14.         } 
  15.     </script> 
Actually i want to use single 'CollapsiblePan elExtender' for many <div> tags, that is i just need to specify in function the targetId of div tags to act on everytime from where the function is called....
Oct 2 '08 #1
1 1843
Frinavale
9,735 Recognized Expert Moderator Expert
Consider using an Accordion Extender instead??

-Frinny
Oct 2 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2499
by: Philo | last post by:
How do I select all <div> tags except those which contain a <table> tag somewhere within them? Example XML: <********************** sample input ***********************> <txtSectionBody> <div> <span>
3
7754
by: KathyB | last post by:
Hi, totally new to the div show/hide thing. I have some rows in a table. When I first load the page, I only want to see divs where the divID=ForView. When I load now, I see BOTH rows...even though I have one set to style="display='none'". When I click on the Edit button on a row, I want to hide that row and in its PHYSICAL place show the ForEdit div for that item...leaving all other divs as is. I've seen some examples, everyone seems...
61
24459
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will 'stretch'</td> <td valign="top" width="300">some data that won't 'stetch'</td> </tr> </table>
7
16995
by: Herbman | last post by:
Hi, I'm trying to position a <tr> ("row") element with CSS. The table itself is positioned with <div> tags. The problem is when I use <div> tags to position the rows within the table nothing happens. In the following example, I want to position two table rows relative to the table itself. Can anyone tell me what I am doing wrong? Please provide sample code.
8
4846
by: localhost | last post by:
I would like to wrap all of the HTML inside of my <body> tag inside a <div> with in my code-behind. I do not want to touch the .aspx page template at all. I know how to make the body tag runat=server and give it an id so I can find it from the code-behind, but after that I want to add the <div>. One problem I see is that I just add the <div> to the <body>, all of the other controls (including the aspx <form>) will not be inside it. What...
9
20176
by: saadkhan | last post by:
I`v made the following code: <div id="Panels" style="width: 28%;"> <asp:Panel ID="one" runat="server" CssClass="Panel"> <div id="Head" onclick="doToggle();"> HEADER </div> </asp:Panel> <asp:Panel ID="two" runat="server" CssClass="Content"> abcdefghijklmnopqrstuvwxyz
4
5277
by: harryusa | last post by:
I am trying to center 2 images concentrically which are z-indexed to lay on top of each other making an image with a border from another image that has a transparent center. I need the images to be horizonally and vertically centered within a <TD> </TD> area. No matter what I do the two image just present one above the other, albeit centered, NOT on top of each other. I originally did the entire page layout in TABLES until I found out I.E. 7...
7
8012
by: cmrhema | last post by:
Hi, I have two questions. 1. I have heard that replacing a <tr> <td> with <div> tags increases the rendering speed. Is it so, and if yes which speed does it increase, rendering speed or loading speed. 2. Is the main purpose of app_browser is to convert <tr><td> to <div> tags.
10
5376
by: Manikrag | last post by:
Hi Team, I searched a lot on this but could not find anything, so I am posting it here. I am using an AutoCompleteExtender in a user control which is in a master page. The page layout is designed byDIV tags. My code in that user control is somehting like.. ---------------------------- <DIV> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:TextBox ID="TextBox1" runat="server" Width="160px"></asp:TextBox>
0
8266
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8638
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7196
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2626
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.