Search Results

Search found 753 results on 31 pages for 'selectors'.

Page 12/31 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • jQuery: Selector confusion

    - by JamesBrownIsDead
    What is wrong with this jQuery selector? $("#masterHeaderMenu.masterHeaderMenuButton a:first") I'm intending to select the first anchor tag that is a child of an element whose class is "masterHeaderMenuButton", itself a child of the element with an "id" attribute value of "masterHeaderMenu". Can't I do this in jQuery?

    Read the article

  • How to serialize as an array of objects from multiple fields in jQuery?

    - by teebot.be
    Hi, I'm using jQuery to dynamically add new divs containing a few fields. I'm adding new tunes in this example of output: <div id="uploadedTunes"> <div class="tune"> Title:<input type="text" name="Title"> Length:<input type="text" name="Length"> </div> <div class="tune"> Title:<input type="text" name="Title"> Length:<input type="text" name="Length"> </div> </div> Is there a way to serialize only the fields in the div uploadedTunes (and not the whole form) ? And how do I serialize this so I have an array like this: uploadedTunes{ tune { Title="highway to hell", Length="03:01" } } Thank you for your help or clues!

    Read the article

  • Will CSS attribute selector work to style this element?

    - by morktron
    Hi, I have the following html: <div class="bf_form_row"> <label for="findout">Text goes here</label> <textarea class="findOut" cols="40" id="findout" name="findout" rows="10"></textarea> </div> I trying to work out how to style the 'label' element without being able to change the html. Ideally I'd like to style all 'label' elements that come before 'textarea' elements but I don't think it is possible using just CSS. I thought this attribute selector would work: label[for="findout"] { width: 100%; } but no, any ideas?

    Read the article

  • Jquery recursive selector

    - by Mazzi
    Hi There, I have whole bunch of <div class="productlistname"><a href="#">The Text!</a></div>. What I want to do go through all .productlistname and truncate the text and replace the current text with the truncated version. Here is what I have so far: $(".productlistname a").html($(".productlistname a").html().substring(0,10)); This just truncate the first one and replaces the rest of .productlistname with the truncated version of the first one.

    Read the article

  • jQuery selector help - Can I generate a selector from clicking on an element?

    - by Kettenbach
    Hi All, I have jQuery, FireFox, Firebug, IE, and IE developer toolbar. When I am examing a page with either FireBug or IE Dev toolbar, I am able to click on an element and it shows me in the dom where the element is etc... Is there anyway to transform that selection into a valid jQuery selector? I know I can use ID, classes, and element relative to other elements etc... but what about when I am looking at some random table cell that doesn't have a class or id etc.. Can I generate a selector on the fly like that? I thought for sure there was. Any thoughts or ideas are always appreciated Thanks, ~ck in San Diego

    Read the article

  • div in an iframe

    - by Hulk
    In an iframe how to make a div to hide and on mouse over the bottom of the page bring it to front again. This is just like a control that appears in medial players,hide when mouse out and show when mouse over <div> <img src="play.gif"/> <img src="next.gif"/> <img src="last.gif"/> <img src="first.gif"/> <img src="previous.gif"/> <img src="next.gif"/> </div> Thanks..

    Read the article

  • How can I change 'self.view' within a button method created outside of 'loadView'

    - by Scott
    Hey guys. So I am creating buttons dynamically within loadView. Each of these buttons is given an action using the @Selector method, such as : [button addTarget:self action:@selector(showCCView) forControlEvents:UIControlEventTouchUpInside]; Now that showCCView method is defined outside of loadView, where this above statement is located. The point of the method is to change the view currently on the screen (so set self.view = ccView). It gives me an error every time I try and access self.view outside of loadView, and even sometimes when I try and access it at random places within loadView, it just has been acting really weird. I tried to change it around so I wouldn't have to deal with this either. I had made a function + (void) showView: (UIView*) oldView: (UIView*) newView; but this didn't work out either because the @Selector was being real prissy about using it with a function that needed two parameters. Any help please? Here is my code: // // SiteOneController.m // InstantNavigator // // Created by dni on 2/22/10. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import "SiteOneController.h" @implementation SiteOneController + (UIView*) ccContent { UIView *ccContent = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; ccContent.backgroundColor = [UIColor whiteColor]; [ccContent addSubview:[SiteOneController myNavBar1:@"Constitution Center Content"]]; return ccContent; } // Button Dimensions int a = 62; int b = 80; int c = 200; int d = 30; // NPSIN Green Color + (UIColor*)myColor1 { return [UIColor colorWithRed:0.0f/255.0f green:76.0f/255.0f blue:29.0f/255.0f alpha:1.0f]; } // Creates Nav Bar with default Green at top of screen with given String as title + (UINavigationBar*)myNavBar1: (NSString*)input { UIView *test = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0.0, 0.0, test.bounds.size.width, 45)]; navBar.tintColor = [SiteOneController myColor1]; UINavigationItem *navItem; navItem = [UINavigationItem alloc]; navItem.title = input; [navBar pushNavigationItem:navItem animated:false]; return navBar; } //-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------// // Implement loadView to create a view hierarchy programmatically, without using a nib. - (void)loadView { //hard coded array of content for each site // CC NSMutableArray *allccContent = [[NSMutableArray alloc] init]; NSString *cc1 = @"House Model"; NSString *cc2 = @"James Dexter History"; [allccContent addObject: cc1]; [cc1 release]; [allccContent addObject: cc2]; [cc2 release]; // FC NSMutableArray *allfcContent = [[NSMutableArray alloc] init]; NSString *fc1 = @"Ghost House"; NSString *fc2 = @"Franklins Letters"; NSString *fc3 = @"Franklins Business"; [allfcContent addObject: fc1]; [fc1 release]; [allfcContent addObject: fc2]; [fc2 release]; [allfcContent addObject: fc3]; [fc3 release]; // PC NSMutableArray *allphContent = [[NSMutableArray alloc] init]; NSString *ph1 = @"Changing Occupancy"; NSString *ph2 = @"Sketches"; NSString *ph3 = @"Servant House"; NSString *ph4 = @"Monument"; NSString *ph5 = @"Virtual Model"; [allphContent addObject: ph1]; [ph1 release]; [allphContent addObject: ph2]; [ph2 release]; [allphContent addObject: ph3]; [ph3 release]; [allphContent addObject: ph4]; [ph4 release]; [allphContent addObject: ph5]; [ph5 release]; // Each content page's view //UIView *ccContent = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; UIView *fcContent = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; UIView *phContent = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; //ccContent.backgroundColor = [UIColor whiteColor]; fcContent.backgroundColor = [UIColor whiteColor]; phContent.backgroundColor = [UIColor whiteColor]; //[ccContent addSubview:[SiteOneController myNavBar1:@"Constitution Center Content"]]; [fcContent addSubview:[SiteOneController myNavBar1:@"Franklin Court Content"]]; [phContent addSubview:[SiteOneController myNavBar1:@"Presidents House Content"]]; //allocate the view self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; //set the view's background color self.view.backgroundColor = [UIColor whiteColor]; [self.view addSubview:[SiteOneController myNavBar1:@"Sites"]]; NSMutableArray *sites = [[NSMutableArray alloc] init]; NSString *one = @"Constution Center"; NSString *two = @"Franklin Court"; NSString *three = @"Presidents House"; [sites addObject: one]; [one release]; [sites addObject: two]; [two release]; [sites addObject: three]; [three release]; NSString *ccName = @"Constitution Center"; NSString *fcName = @"Franklin Court"; NSString *element; int j = 0; for (element in sites) { UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; //setframe (where on screen) //separation is 15px past the width (45-30) button.frame = CGRectMake(a, b + (j*45), c, d); [button setTitle:element forState:UIControlStateNormal]; button.backgroundColor = [SiteOneController myColor1]; /*- (void) fooFirstInput:(NSString*) first secondInput:(NSString*) second { NSLog(@"Logs %@ then %@", first, second); } - (void) performMethodsViaSelectors { [self performSelector:@selector(fooNoInputs)]; [self performSelector:@selector(fooOneInput:) withObject:@"first"]; [self performSelector;@selector(fooFirstInput:secondInput:) withObject:@"first" withObject:@"second"];*/ //UIView *old = self.view; if (element == ccName) { [button addTarget:self action:@selector(showCCView) forControlEvents:UIControlEventTouchUpInside]; } else if (element == fcName) { } else { } [self.view addSubview: button]; j++; } } // This method show the content views for each of the sites. /*+ (void) showCCView { self.view = [SiteOneController ccContent]; }*/

    Read the article

  • Empty file fields

    - by user319319
    i must check all :file fields, all fields must be not empty. i use code function CheckFiles() { var t = $('.uploadElement:empty').size(); alert(t); } but t return all uploadElement elements count. how to get empty :file fields? sorry my english

    Read the article

  • JQuery invert table selection

    - by Lars Tackmann
    I have page part like this <div id="inbox"> <h1>Headline</h1> <p>First paragraph</p> <table> <tbody> <tr> <td>table stuff</td> </tr> </tbody> </table> <p>Second paragraph</p> </div> I want to assign a handler to everything within the #inbox div that is not a part (a child) of the table. I tried to do something like $('#inbox:not(:has(table))').click(function(){ alert('hello inbox'); }); But that does not work, so how do I invert the selection of the table inside the #inbox ?

    Read the article

  • Selector to select third list item?

    - by Richard Knop
    Suppose a HTML markup like this: <ul> <li>List item 1</li> <li>List item 2</li> <li>List item 3</li><!-- I want to select only this --> </ul> Would it be possible to select only the third list item in the unordered list element? I've been browsing the jQuery documentation but I can't find any selector that could do this.

    Read the article

  • Selecting an element based on class and id in jquery - similar to an SQL query

    - by Ankur
    I want to select an element based on it's class and id, I have seen many similar questions on SO. Most of the users ask why would you ever want to do this - which is not very helpful, trust me, this is the simplest way of solving my UI problem, and it's a very unique and intereting UI related to making generic triple stores easily browsable. At the moment the jQUery looks like this: $(document).ready( function() { $(".predicates").hide(); $(".objects").hide(); $("#subject").click( function() { $("#predId, .predicates").toggle(); // this line } ); $("#predId").click( function() { $("#objId, .objects").toggle(); } ); }); The line I am really interested in is this $("#predId, .predicates").toggle(); how do I get the select to ensure that both #predId and .predicates are true, at the moment it seems that only one or the other has to be true. Is there something like an && operator?

    Read the article

  • id vs class selection benchmark

    - by zaf
    Has anybody bench marked selecting elements with id's and class's from CSS and javascript? It would make sense that an element with an id is faster to select than if it had a class even if it was the only element with that class. Do I really need to be concerned?

    Read the article

  • Rebind dymanically created forms after jQuery ajax response

    - by Pjack
    I'm kinda new to jQuery but understand it for the most part. My problem is that when my ajax call which refreshes the entire div is done, all my dynamically created forms don't work. If you try and submit them, the event doens't work properly and just tries to do a normal form submit. I have all the other items such as links bound using the .live() which seem to work great. Just the form dies. How do I rebind the dynamically created forms after the ajax call? They all have id of formname_id. I tried to use bind but it doesn't work as below. Any help is appreciated. Here is the code jQuery(document).ready(function(){ jQuery("form[id^='commentform_']").each(function(){ var id = parseInt(this.id.replace("commentform_", "")); jQuery(this).bind('submit', function(e) { var action = jQuery('#action_' + id).attr('value'); var act_id = ('1'); jQuery.ajax({ type: "POST", url: "ajax/modify.php", data: "action="+ action +"& act_id="+ act_id, success: function(response){ jQuery('#CommentsContainer_' + id).html(response); jQuery('#commentform_' + id)[0].reset(); } }); return false; }); }); });

    Read the article

  • How to return radio checked object with jQuery ?

    - by Kim
    HTML <input type="radio" name="rdName" id="uniqueID1" value="1" checked="checked"> <input type="radio" name="rdName" id="uniqueID2" value="2"> <input type="radio" name="rdName" id="uniqueID3" value="3"> jQuery #1 $('input:radio[name=rdName]:checked').val(); jQuery #2 $('input[name=rdName]:checked'); jQuery #1 gets the value of checked radio, but I need to get the whole object to get the ID. jQuery #2 get this (from Chrome Dev console). Object "0" is the actual object I need, but I am unable to just that. 0: HTMLInputElement constructor: function Object() context: HTMLDocument length: 1 prevObject: Object selector: input[name=rdName]:checked __proto__: Object Any ideas how to isolate the needed object ?

    Read the article

  • jquery load function for small preview

    - by Hulk
    Preview:          In the following div i need to show a very small preview of a page.In order to do that what should be the css set to, When i use the following code below,the preview is very big.I need to show the preview with the size of the videos on you tube(as In suggestions tab) var url="/tools/display/" + param; $('#preview').css({"width" : "200px" , "height" : "10px" , "background-color" : "Black" , "position" : "fixed","display" : "inline" }); $("#preview").load(url); Thanks..

    Read the article

  • Descendent or self selector in jQuery

    - by tttppp
    I want to search for all elements with class needle in all elements returned by jQuery('.haystack') and have tried jQuery('.haystack .needle'), but this doesn't seem to pick up the case where an element has both classes. Is there a selector that will do this?

    Read the article

  • jquery nextUntil has element

    - by Mark
    jquery nextUntil has element I have a bunch of elements like this: <div></div> <span></span> <table></table> <div></div> <span></span> <div></div> I need to check whether or not there's a table element in between the divs, and if so do something. $('div').each(function () { if ($(this).nextUntil('div').include('table')) { $(this).addClass('got-a-table'); } } Something like this? I know that there's no include method, is there something that can get me what I need? Thanks. Result should be like this: <div class='got-a-table'></div> <span></span> <table></table> <div></div> <span></span> <div></div>

    Read the article

  • Androd ListView style

    - by xger86x
    Hi, i have a question about list views. I hope anyone knows the solution because i have been trying to solve this problem all the weekend. Well, i have a custom list view in which every row have a custom .xml (item_row.xml) with a set color background for the row item. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="70dip" android:orientation="vertical" android:background="@drawable/list_bg"> The problem is when i try to make a selector for the list. I want two things: When the item is focused, appears the typical orange rectangle over him. When the item is pressed the same. I have proved with a selector and a custom style but all i get is or the selector doesn't appear or the selector covering the item so i can't see it. If anyone can give me the right code i will be very grateful. Thanks

    Read the article

  • jquery selector help... thought I followed the example correctly...but can't get it to work..

    - by Ronedog
    I'm trying to do the following in jquery but can't make it work . I want to select all the DIV tags that have a custom attribute called NODE_ID that have a value of 49_3. then select the and change the src attribute to a different image. Here's the HTML: <div style="display: block;" id="71_7_sub_p_div" node_id="49_3"> <span> <img src="../images/maximize.png"> &nbsp;Greenfield Industrial Park </span> </div> Here's the script: <script type="text/javascript"> $(document).ready(function(){ $("div[node_id='49_3']:has(img)").attr("src","../images/folder_closed.png"); }); </script> Any ideas are appreciated. thanks.

    Read the article

  • jquery select element inside a class

    - by Erwin
    Hi fellow programmer I want to select an anchor inside a div like this <div class="response content"> Disapproved Bank Mandiri<br><br> <p> <a class="showlist" href="#">Back to list?</a> </p> </div> What is the jquery to do this ?

    Read the article

  • jQuery detect visible but hidden elements

    - by IP
    This seems like it should be fairly easy - but I can't find the right selector for it According to the docs (http://api.jquery.com/hidden-selector/ and http://api.jquery.com/visible-selector/)... Elements can be considered hidden for several reasons: An ancestor element is hidden, so the element is not shown on the page. What I want to detect is "this element is visible, but is contained in a hidden parent". Ie, if I made the parent visible, this element would also be visible.

    Read the article

  • Searching for Nodes with Specific Text using the Prototype Javascript Framework

    - by Alan Storm
    Does the Prototype Javascript library have a selector that's equivalent to jQuery's :contains()? If not, what would what be "The Prototype Way" to selector/filter-down a list of elements that contains a particular string. For example, using the following $$('#some_div dd a') I may get back an array of 50 or so links. I only want the links that contain the work 'home'. In jQuery I'd do this jQuery('#some_div dd a:contains('home')'); Is it possible to do something similar using Prototype? If not, is there an elegant way to filter out the array of 50 elements that gets returned.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >