Solved

Jquery Tabs - Showing all divs instead of just parent

Posted on 2012-12-22
4
187 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
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)

813 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

13 Experts available now in Live!

Get 1:1 Help Now