Solved

find element...then backtrack to parent with id = "foo"

Posted on 2013-05-15
2
334 Views
Last Modified: 2013-05-15
In jQuery, I want to find an element...then backtrack to first parent div with id = "frame"



or



select all frames that have ANY children with this tag:

<th scope="col">Original Due Date</th>

and then hide the background-image associated with those frames.


<div id="frame" style="background-image: blah blah; border: 1px solid red;">
    <div id="frame_header" style="height: 0px;">
        

                <div id="frame_navigation" style="height: 0px; border-bottom-color: blue; border-bottom-style: solid; border-bottom-width: 1px; width: 0px;">
        	        <ul id="ctl09_ctl02_AssetFrameNavigation1_tabList" style="display: none;">
            	       <!-- <li><a href="test.html" title="tasks" class="frame_tab" rel="shadowbox[test]">Tasks</a></li>
            	        <li><a href="http://google.com" title="Test" class="frame_tab" rel="shadowbox[test]">Asset</a></li>
            	        <li><a href="http://google.com" title="Test" class="frame_tab" rel="shadowbox[test]">Marketing</a></li>
            	        <li><a href="http://google.com" title="Test" class="frame_tab_current" rel="shadowbox[test]">Valuation</a></li>
            	        <li><a href="http://google.com" title="Test" class="frame_tab" rel="shadowbox[test]">Photos/Docs</a></li>
            	        <li><a href="http://google.com" title="Test" class="frame_tab" rel="shadowbox[test]">Comments</a></li>
            	        <li><a href="http://google.com" title="Test" class="frame_tab" rel="shadowbox[test]">Property Preservation</a></li>
            	        <li><a href="http://google.com" title="Test" class="frame_tab" rel="shadowbox[test]">Eviction</a></li>
            	        <li><a href="http://google.com" title="Test" class="frame_tab" rel="shadowbox[test]">Inspections</a></li>
            	        <li><a href="http://google.com" title="Test" class="frame_tab" rel="shadowbox[test]">Agent Forms</a></li>
            	        <li><a href="http://google.com" title="Test" class="frame_tab" rel="shadowbox[test]">Closing Title</a></li>-->
                        <li class="frame_navigation_no_tab">
                	        
                        </li>
                    <li><a id="ctl09_ctl02_AssetFrameNavigation1_MARKET" class="frame_tab" href="Asset.aspx?MenuId=106&amp;AssetID=32380-1">Marketing</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_COMMENTS" class="frame_tab" href="Asset.aspx?MenuId=107&amp;AssetID=32380-1">Comments</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_MLSVRFYI" class="frame_tab" href="Asset.aspx?MenuId=370&amp;AssetID=32380-1">Asset Watch</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_OfferBuyers" class="frame_tab" href="Asset.aspx?MenuId=303&amp;AssetID=32380-1">Offer</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_AssetTask" class="frame_tab" href="Asset.aspx?MenuId=228&amp;AssetID=32380-1">Asset Task</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_CONTINFO" class="frame_tab" href="Asset.aspx?MenuId=229&amp;AssetID=32380-1">Contact Info</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_Task_FollowUp" class="frame_tab" href="Asset.aspx?MenuId=219&amp;AssetID=32380-1">Follow Up</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_AgentForms" class="frame_tab" href="Asset.aspx?MenuId=127&amp;AssetID=32380-1">Agent Forms</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_Eviction" class="frame_tab" href="Asset.aspx?MenuId=50&amp;AssetID=32380-1">Eviction</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_Preserv" class="frame_tab" href="Asset.aspx?MenuId=74&amp;AssetID=32380-1">Property Preservation</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_InspHist" class="frame_tab" href="Asset.aspx?MenuId=230&amp;AssetID=32380-1">Inspection History</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_PhotoDocs" class="frame_tab" href="Asset.aspx?MenuId=8&amp;AssetID=32380-1">Photos Docs</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_TESTHUD" class="frame_tab" href="Asset.aspx?MenuId=72&amp;AssetID=32380-1">Closing/Title</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_Exp_AFilter" class="frame_tab" href="Asset.aspx?MenuId=20&amp;AssetID=32380-1">Expenses</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_AssetInfoMain" class="frame_tab" href="Asset.aspx?MenuId=111&amp;AssetID=32380-1">Asset Info</a></li><li><a id="ctl09_ctl02_AssetFrameNavigation1_AuditAsset" class="frame_tab" href="Asset.aspx?MenuId=154&amp;AssetID=32380-1">Audit</a></li></ul>
                </div>
        <!-- This is the frame main navigation tabs -->
        <div id="frame_title">
            <h1>Asset Task</h1>
            <!-- Page tile -->
        </div>
        <div id="frame_header_secondary_Navigation" class="shown" style="height: 0px;">
            <!-- This area is for the secondary navigation -->           
        </div>
    </div>
    <div id="corpus">        
       <h6>Postponed Task</h6>
        <div id="ctl09_ctl02_divPostponedTaskGrid">
            <div>
			<table class="grid_view" cellspacing="0" id="gvPostponedTaskGrid" style="border-collapse:collapse;">
				<tbody><tr class="grid_view_header">
					<th scope="col">Original Due Date</th><th scope="col">New Due Date</th><th scope="col">Date Postponed</th><th scope="col">Postponed By</th><th scope="col">Postpone Comment</th>
				</tr><tr>
					<td>
                            <span id="ctl09_ctl02_gvPostponedTaskGrid_ctl02_lblOriginalDueDate">Jan 17 2013 11:59PM</span>
                        </td><td>
                            <span id="ctl09_ctl02_gvPostponedTaskGrid_ctl02_lblNewDueDate">Feb 15 2013 11:59PM</span>
                        </td><td>
                            <span id="ctl09_ctl02_gvPostponedTaskGrid_ctl02_lblDatePostponed">1/18/2013 1:44:29 PM</span>
                        </td><td>
                            <span id="ctl09_ctl02_gvPostponedTaskGrid_ctl02_lblPostponedBy">Shannan Hoffman</span>
                        </td><td>
                            <span id="ctl09_ctl02_gvPostponedTaskGrid_ctl02_lblPostponeComment"></span>
                        </td>
				</tr><tr class="grid_view_alt_row">
					<td>
                            <span id="ctl09_ctl02_gvPostponedTaskGrid_ctl03_lblOriginalDueDate">Feb 15 2013 11:59PM</span>
                        </td><td>
                            <span id="ctl09_ctl02_gvPostponedTaskGrid_ctl03_lblNewDueDate">Feb 22 2013 11:59PM</span>
                        </td><td>
                            <span id="ctl09_ctl02_gvPostponedTaskGrid_ctl03_lblDatePostponed">2/19/2013 1:57:53 PM</span>
                        </td><td>
                            <span id="ctl09_ctl02_gvPostponedTaskGrid_ctl03_lblPostponedBy">Shannan Hoffman</span>
                        </td><td>
                            <span id="ctl09_ctl02_gvPostponedTaskGrid_ctl03_lblPostponeComment"></span>
                        </td>
				</tr>
			</tbody></table>
		</div>          
        </div>
    </div>
</div>

Open in new window

0
Comment
Question by:Tom Knowlton
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39169924
Not sure if this what you are looking for or if it will work in the real world
http://jsfiddle.net/FgmDC/2/

(I'm just setting the background to red to know its working)
0
 
LVL 5

Author Closing Comment

by:Tom Knowlton
ID: 39169945
Gary,

This was perfect.

I have another Q.

Coming soon!
0

Featured Post

Independent Software Vendors: 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

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
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 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…

685 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