Solved

Jquery Tabs - Showing all divs instead of just parent

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

746 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

12 Experts available now in Live!

Get 1:1 Help Now