Solved

Jquery Tabs - Showing all divs instead of just parent

Posted on 2012-12-22
4
192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
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)

733 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