Solved

Jquery Tabs - Showing all divs instead of just parent

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Jquery GMAP3 Hierarchy 1 35
tiny glitch in my main slider 3 39
check a checkbox of a checkboxes group in bootstrap 2 41
jQuery on Submit 4 41
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
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)

856 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