Search Results

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

Page 15/31 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • how to use trigger in Jquery to pass parameter data as well as control (this)

    - by Shantanu Gupta
    I am trying to use same validation funtion for all my controls. But I dont know much in jquery and not been able to pass event handler to the trigger. I want to pass textbox id to my custom function. How can i do this <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#txtFirstName").bind('focusout', function() { $(this).trigger("customblurfocus",[$(this).val(), $(this).val() + " Required !", "Ok !"]); } ); $(this).bind('customblurfocus',function(defaultInputValue,ErrorMessage,ValidMessage) {alert($(this).val()); if($(this).val()=="" || $(this).val()==defaultInputValue) { $(this).val(defaultInputValue); $(this).siblings("span[id*='error']").toggleClass("error_set").text(ErrorMessage).fadeOut(3000); } else { $(this).siblings("span[id*='error']").toggleClass("error_ok").text(ValidMessage).show(1000); } } ); }); </script>

    Read the article

  • jQuery child selector expression

    - by Saiful
    <div id="div"> <div> <!-- first level --> <div> <!-- second level --> <div>1.1</div> <!-- third level --> <div>1.2</div> </div> <div> <div></div> <div>2.2</div> </div> </div> </div> What are the jQuery selector expressions for selecting the followings: 1. div commented by first level 2. divs commented by second level 3. divs commented by third level

    Read the article

  • How to show html template using inline styles only?

    - by aquero
    Hi, I want to display html template in a webpage. The styles of that template is specified inline. But when i try to display it in my webpage, some styles that are defined in my css are adding into it and the template is not displayed properly. This template is used to create mails and when i send this template as mail to my gmail account it is displayed correctly. How its done in gmail? How they show the template using inline styles only?

    Read the article

  • jQuery select number of tags

    - by ninumedia
    I have multiple comment ids I want to reset to a default value. Ex: <a id="comments_inner_toggle_45">example 1</a> <a id="comments_inner_toggle_608">example 2</a> <a id="comments_inner_toggle_28">example 3</a> ... How can I write the correct tag in jQuery to select every tag with an id of "comments_inner_toggle_" and perform some operation on it? I think it's something similar to: $('a[id|=comments_inner_toggle_]').whatever This is wrong however because the code above will only match the tag with "comments_inner_toggle_" and not with a number appended at the end. How can I fix this? thanks for the help! :)

    Read the article

  • jquery closest dl element

    - by Sebastiaan
    HTML: <dl id="feature-list"> <dt id="basic" class="category-name"> <dd id="basic-toggle" class="category-recepient"> <div class="feature"> <div class="feature-content"> <input id="checkbox1" type="checkbox"> </div> </div> </dd> <dt id="options" class="category-name"> <dd id="options-toggle" class="category-recepient"> <div class="feature"> <div class="feature-content"> <input id="checkbox2" type="checkbox"> </div> </div> </dd> </dl> JQUERY $('input').change(function () { var value = $(this).closest("dt"); //do something with value.id }); $(this).closest("dt") returns the checkbox instead of <dt id="(category)" class="category-name"> I tried $(this).closest(.category-name), $(this).closest("dt").find(.category-name)

    Read the article

  • Select CSS based on multiple classes

    - by Stacey
    I have a style rule I want to apply to a tag when it has TWO styles. Is there any way to perform this without javascript? In other words.. <li class='left ui-class-selector'> I want to select only if the li has both 'left' and 'ui-class-selector' classes applied.

    Read the article

  • jquery selector

    - by Sotos
    hello, i have the below sample code for a navigation list: <div id="menu"> <ul> <li><a href="#sect1">link 1</a></li> <li><a href="#sect2">link 2</a></li> <li><a href="#sect3">link 3</a></li> </ul> </div> and some jquery code: $("#menu li").click(function () { var mylicontent=$(this).html(); }); i want to get both html content of the li object and the href value. Any ideas?

    Read the article

  • Weirdest occurrence ever, UIButton @selector detecting right button, doing wrong 'else_if'?

    - by Scott
    So I dynamically create 3 UIButtons (for now), with this loop: 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 *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]; [button addTarget:self action:@selector(showCCView:) forControlEvents:UIControlEventTouchUpInside]; [button setTag:j]; [self.view addSubview: button]; j++; } The @Selector method is here: - (void) showCCView:(id) sender { UIButton *button = (UIButton *)sender; int whichButton = button.tag; NSString* myNewString = [NSString stringWithFormat:@"%d", whichButton]; self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; self.view.backgroundColor = [UIColor whiteColor]; UINavigationBar *cc = [SiteOneController myNavBar1:@"Constitution Center Content"]; UINavigationBar *fc = [SiteOneController myNavBar1:@"Franklin Court Content"]; UINavigationBar *ph = [SiteOneController myNavBar1:@"Presidents House Content"]; if (whichButton = 0) { NSLog(myNewString); [self.view addSubview:cc]; } else if (whichButton = 1) { NSLog(myNewString); [self.view addSubview:fc]; } else if (whichButton = 2) { NSLog(myNewString); [self.view addSubview:ph]; } } Now, it is printing the correct button tag to NSLog, as shown in the method, however EVERY SINGLE BUTTON is displaying a navigation bar with "Franklin Court" as the title, EVERY SINGLE ONE, even though when I click button 0, it says "Button 0 clicked" in the console, but still performs the else if (whichButton = 1) code. Am I missing something here?

    Read the article

  • How to append html to first occurance of string after selected element

    - by uku
    Hello, I have html like so: <div class=foo> (<a href=forum.example.com>forum</a>) <p> Some html here.... </div> And I want to insert another link after the first one, like so: <div class=foo> (<a href=forum.example.com>forum</a>) <a href=blog.example.com>blog</a> <p> Some html here.... </div> ...but because it is enclosed in () I cannot use: $('div.foo a:first').append(' <a href=blog.example.com>blog</a>'); ...which would place it before the ). So how can I extend my jQuery selection to select the literal ) or do I need to use another solution?

    Read the article

  • CSS :nth-child Equation

    - by Meander365
    I have an unordered list and each li makes up one item in a two column layout: col1 col2 1 2 3 4 5 6 7 8 9 10 11 12 I need to have an alternating background colour for each item BUT NOT so each item in one column is the same. So : 1,4,5,8,9,11 will have one colour; and 2,3,6,7,10,12 will have another colour. Can this be achieved with one :nth-child rule? Thanks!

    Read the article

  • jQuery: How to find elements *without* a class set

    - by Alan
    Hey jQuery clever peeps, Why does this fail... $( 'div.contactAperson input' ).not( 'input.hadFocus' ).focus(function() { $(this).attr('value', '' ); }); ...it's meant to sniff out input's that have not got the class .hadFocus and then when one of that subset receives focus it should zap the value to null. Right now, input values are always getting zapped -- the test .not( 'input.hadFocus' ) is failing to stop execution. Btw, preceding the above code is the following code, which is working fine: $( 'div.contactAperson input' ).focus(function() { $( this ).addClass( 'hadFocus' ); }); Thanks for any cleverness - cheers, -Alan

    Read the article

  • jQuery: How to hide all HTML elements which have a value greater than a certain value for a given ta

    - by Ankur
    I display elements in a hierarchy, clicking one displays the next set of elements in the hirearchy. Each element has a tag called "level" which has some value which is 1-.... (whatever the number of levels is for that branch of the tree). When an element is clicked I want the next elements to be displayed, but if an element is clicked and it's subelements have already been displayed I want to hide all subelements. More formally: when an element with level = x is clicked if no elements with level x are displayed then display all elements such that level = x+1 but if some elements with level x are displayed then hide all elements where level x How would I create a jQuery selector that captures this.

    Read the article

  • jquery contains with class

    - by proee
    I'm using jQuery :contains selector to filter through some link tags. The following code works great. $('a:contains('string').each(function(i){ //do some stuff }); I'd like only run this function if the anchor tags are inside a specific class, I've tried the following but it does not appear to work: $('my_class a:contains('string').each(function(i){ //do some stuff });

    Read the article

  • Add event to all elements except the given with jQuery

    - by Metropolis
    Hey everyone I created a date picker that uses ajax to populate an element with an id of calendarContainer. When the user clicks on a button to bring the calendar up, I want the user to be able to click anywhere else on the screen besides the calendar and have it hide. The calendarContainer is at the root of the dom and I have tried everything I can think of to get this working. I have gotten the calendar to go away when it is not clicked on. However, when I click on the calendar it is also going away. I only want the calendar to go away when it is not clicked on. Here are all of the things I have tried. $(":not(#calendarContainer > table)").live('click', function() { $.Calendar.hide(); }); $(":not(#calendarContainer").live('click', function() { $.Calendar.hide(); }); $(":not(#calendarContainer)").click(function() { $.Calendar.hide(); }); $("body:not(#calendarContainer)").click(function() { $.Calendar.hide(); }); $(":not(#calendarContainer, #calendarData)").live('click', function() { $.Calendar.hide(); }); Thanks for any help, Metropolis

    Read the article

  • use JQuery to get a list of classes

    - by John
    Hi I have a un-ordered (ul) html list. Each li item has 1 or more classes attached to it. I want to go through this ul list and get all the (distinct) classes. Then from this list create a list of checkboxes who's value matches that of the class and also who's label matches that of the class. One checkbox for each class. What is the best way to do this using JQuery? Thanks

    Read the article

  • How to refresh jQuery Selector Value after an execution?

    - by Devyn
    Hi, I have like this. $(document).ready(function() { var $clickable_pieces = $('.chess_piece').parent(); $($clickable_pieces).addClass('selectee'); // add selectee class var $selectee = $('.chess_square.selectee'); // wait for click $($selectee).bind('click',function(){ $('.chess_square.selected').removeClass('selected'); $(this).addClass('selected'); { ........... } }); I initially inject 'selectee' class to all div which has 'chess_piece' class then I select DIVs with that class $('.chess_square.selectee'). <div id="clickable"> <div id="div1" class="chess_square"> </div> <div id="div2" class="chess_square selectee"> <div id="sub1" class="chess_piece queen"></div> </div> <div id="div3" class="chess_square"> </div> </div> There are two type of DIV element with class named 'chess_square selectee' and 'chess_square' which doesn't meant to be clickable. I move around Sub DIV of 'rps_square selectee' from DIV2 to DIV1 and add and remove classes to be exactly same like this. The meaning is Queen Piece is moved from Div2 to Div1. <div id="div1" class="chess_square selectee"> <div id="sub1" class="chess_piece queen"></div> </div> <div id="div2" class="chess_square"> </div> <div id="div3" class="chess_square"> </div> However, the problem is jQuery doesn't update var $selectee = $('.rps_square.selectee');. Even though I changed class names, DIV1 is not clickable and DIV2 is still clickable. By the way, I've used jQuery UI selectable but doesn't refresh either.

    Read the article

  • CSS Select only List after 1st layer

    - by Gidiyo
    Given <ul class="menu"> <li> <!-- layer1 --> <a href="/gbcweb/index.php?option=com_content&amp;view=article&amp;id=19&amp;Itemid=27"> <span>sub menu</span> </a> <ul> <li><!-- layer2 --> <a href="/gbcweb/index.php?option=com_content&amp;view=article&amp;id=22&amp;Itemid=34"> <span>sub menu1</span> </a> <ul> <li><!-- layer3 --> <a href="/gbcweb/index.php?option=com_content&amp;view=article&amp;id=22&amp;Itemid=34"> <span>sub menu2</span> </a> <!-- Continue layering --> </li> </ul> </li> </ul> </li><ul> How do I select all the from layer 2 onwards?And set a background image to all sub menu.

    Read the article

  • [JQuery] Highlight a Radio field and then pop up an input text box field

    - by kwokwai
    Hi all, I am trying to make some dynamic effect to a HTML page using JQuery. 1. When the user clicks a Radio feild, the field will be highlighted. 2. When the user clicks the Radio 'Man', a Input text box will be provided immeditely just below it. Here is my simple HTML page, but I don't know how to do with the JQuery part: <Table> <TR> <TD>Gender</TD> <TD> Man: <INPUT type=radio name="gender" value="M"><Br/> Woman: <INPUT type=radio name="gender" value="F"> </TD> </TR> <?Table>

    Read the article

  • jquery :last missing multiple classes

    - by mickyjtwin
    I have an unordered list, and am using jquery to find the last ul and apply a class. jQuery("ul.class1:last").addClass("lastUi"); The html is as follows: <ul class="class1"></ul> <ul class="class1"></ul> This is working fine, however it has now changed in that another class is being added to the list so the html looks like: <ul class="class1"></ul> <ul class="class1 class2"></ul> <ul class="class1"></ul> <ul class="class1 class2"></ul> The jQuery code is now not picking up the last ul with both class1 and class2 as the last element and isn't adding the lastUI class.

    Read the article

  • How can I track down these Firefox warning messages?

    - by Charles Anderson
    Since I upgraded to jQuery 1.4.4 I've been getting several new warning messages when I run my unit tests in Firefox 3.6.13. Here's a typical one: Warning: Unexpected token in attribute selector: '!'. Source File: http://localhost/unitTests/devunitTests.html Line: 0 Or the even more useful: Warning: Selector expected. Source File: http://localhost/unitTests/ui/editors/iframe2.html?test=15 Line: 0 The web page renders nicely, and all my JavaScript code seems to be running okay too, so I'm reluctant to spend a potentially large amount of time chopping away at my code to track these messages down. However, can anyone suggest what's provoking the warnings?

    Read the article

  • CSS problem in IE7 and IE8

    - by damodar
    i have problem in IE7 and IE8 i have used ordered list with css for its li.It is ok in other browse. The problem is that list starts with 1 and then jumps to 3 and then 5 and respectively. how should i handle this...??

    Read the article

  • Hide all LI from a separate UL other than the first

    - by liebgott
    Hello I want hide every LI from a UL other than the first, but the result is that it hides all except the very first LI of all UL's. (I want "show" the first LI of every UL). How can i do that??? <ul> <li>first</li> <li>second</li> </ul> <ul> <li>first</li> <li>second</li> </ul> When i do this only identified the first item of all UL $('.smallYears ul li:not(:first)').hide(); Thank you very much

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >