Solved

Jquery Tabs - Showing all divs instead of just parent

Posted on 2012-12-22
4
183 Views
Last Modified: 2013-02-15
I want to know how to show all content of a div.  For any given div if it and all its children and grand children to the 100th generation are hidden whether they be paragraph tags or script tags or any tag you can possibly think of and whatever is inside them how do I make it all show.  Like as if it were a bag and I just dumped out everything in it so that everything is lying there on the floor how do I do it?  I tried the contents() but it only shows some things.  I want to show everything every last tag text script tag it doesn't matter.  All the Children grand children and great grand children to the infinite generation.
0
Comment
Question by:vrosas_03
  • 2
4 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 250 total points
ID: 38716920
.contents() should return ell elements html and text alike.
can u post an example where its not working as expected?
0
 
LVL 15

Assisted Solution

by:StealthyDev
StealthyDev earned 250 total points
ID: 38719901
Hi,

Hope you are looking for .find("*")
Also, see my sample code below..

<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script>
$(document).ready(function() {
    $("#outer").find("*").show();
});
</script>
<div id="outer">
    <div style="display: none">
         <div style="display: none">
             1
             <div style="display: none">
                 <div style="display: none">
                     2
                     <div style="display: none">
                         <div style="display: none">
                             52
                             <div style="display: none">
                                 <div style="display: none">
                                     hi hello...
                                 </div>
                             </div>
                         </div>
                     </div>
                 </div>
             </div>
        </div>
    </div>
</div>

Open in new window

0
 
LVL 42

Expert Comment

by:sedgwick
ID: 38719923
are u struggling with iframe content?
0
 

Author Comment

by:vrosas_03
ID: 38725341
Not Iframe Im just using jQuery to manage pages on a website by using divs instead of pages

I eventually used contents()
Is there a selector that would allow me to do just use show()
something like:

$("page_div *, $page_div").show()

instead of having to use

$("#page_div").contents().show();

		$("#menu").on("click", "a", function(e){
				
					e.preventDefault();
					$page = $(this).attr("href");
					$page_id = $page.replace(/([a-zA-Z0-9])\.php/,"$1");
					$("#content").contents().hide();

					$("#" + $page_id).show();
					$("#" + $page_id).contents().show();


				});

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Open an ul or div with hover on a li,how? 9 36
New to Angular - How do I define the table columns 5 28
delete database record with modal 21 77
Replace &lt; with < 14 54
This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now