[jQuery] Re: Click event outside of an element
Works fine! Thanks!! :o) On 21 nov, 15:29, mofle wrote: > Here you go: > > $(document).click(function(){ > alert('clicked outside classname'); > > }); > > $('.classname').click(function(e){ > e.stopPropagation(); > > }); > > First you bind a click event to the document with the action you want. > Then you bind the classname to stop it from propagate up to the > document root. > > On Nov 20, 2:29 pm, Keysher wrote: > > > > > Hi! > > > I am newbie in JQuery. I want to catch click event outside and > > specified class. > > > For example, I have a div with class "classname", and I want to attach > > some actions when I click outside, in the rest of the page. > > > I tried with this (to get the classname where I click): > > > $('*').click(function(){ > > alert($(this).attr('class')); > > > }); > > > But not works! > > > Any idea? > > > Thanks! > > > P.D: sorry for the bad english!- Ocultar texto de la cita - > > - Mostrar texto de la cita -
[jQuery] How to install superfish
plz i am a newbie in web desinging and i came across superfish cos i have been looking for a way of installing or adding a dropdown menu in my website, so can you help me with a detailed solution to how i can successfully install superfish on my website?
[jQuery] jquery loses attributes in hidden tables
Hi everybody! I have a little problem using latest jquery (1.3.2): in a page I have some hidden tables with display:none, and if I make them visible for example using the slideDown animation with jquery, some attributes of the tables' rows get lost. For example, all colspans are completely ignored when the tables are shown at the end of the animation! Is there a way to fix this?
Re: [jQuery] Simple jQuery question
Works like a charm! Thanks! Olaf wrote: > > Julesfrog schrieb: > >> Now my question. At this point, the button disappears only when the user >> hit >> the 500 mark. I would like it to disappear and stay invisible when the >> user >> reaches the 500 mark and anything below. I think it's got to do with this >> line: if(jQuery(this).scrollTop() != 500) but I just don't know the right >> "wording". > > Yes, is simple ;) > > Try this: > if(jQuery(this).scrollTop() >= 500) > > -- > Viele Grüße, Olaf > > --- > olaf.bo...@t-online.de > http://olaf-bosch.de/ > http://ohorn.info/ > http://www.akitafreund.de/ > --- > > -- View this message in context: http://old.nabble.com/Simple-jQuery-question-tp26443552s27240p26464167.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Getting message in information bar in IE 8
When I bring up my website that has the Jquery code in it I get a information bar at the top of IE 8 saying it blocked this webpage from running scripts or Active X controls that could access my computer I then click it for more info and then I can click allow blocked content. How do I make this go away? Is it doing it cause of the settings of my IE or is it something wrong with the code? Thanks for any help anyone can give.
[jQuery] Validation remote not working in ie
I have a form with validation remote. The form is loaded through ajax call. The remote validation works in Firefox, Opera and Chrome except IE. When I run it on IE, I can not submit the form, it throws an error: Message: Object doesn't support this property or method Line: 718 Char: 4 Code: 0 URI: http://localhost:8080/FSS/js/jquery.validate.js Any help is very high appreciated. Thanks
[jQuery] Tablesorter date help
Hi, I'm using this plugin and need to filter the date, but am having difficulties. Do you know how I would sort dates in the format mm/ ? Thanks
[jQuery] (validation) Validation remote not working in ie
I have a form with validation remote. The form is loaded through ajax call. The remote validation works in Firefox, Opera and Chrome except IE. When I run it on IE, I can not submit the form, it throws an error: Message: Object doesn't support this property or method Line: 718 Char: 4 Code: 0 URI: http://localhost:8080/FSS/js/jquery.validate.js Any help is very high appreciated. Thanks
[jQuery] Write jQuery Data
I have 2 servers, a front end and a backend. I cannot execute server side scripts on the front end server. I need to get information from a form and pass it to my backend server. I must use Ajax for this. I am doing this with jQuery. I would like to store the form field information in JSON format and then read it on the backend server. How would I go about this, thanks.
[jQuery] Regarding dynamic loading of pages
Hello, I am developing a website : http://www.stonybrook.edu/lihj/LongIslandHistoryJournalStagingArea/index.html Here, the index page has 4 tabs and i am using the divTabFrame.load() function to load a page into a frame dynamically. where divTabFrame is the "div" where my dynamic page should appear. I also have links to these tabs on the navigation bar . So if i am on the index page and click on any of the "Articles, Reviews , Interviews" ,the appropriate page gets loaded in the tab. This works fine. However, when i am on any page other than an index page, and if i click on any of the "Articles, Reviews , Interviews", then this does not work because, though the correct page goes to "divTabFrame.load()", it does not get an actual url to load. Can someone please suggest a way to do it? Thanks.
[jQuery] backgroundPosition plugin
Hey all, I was faced with a challenge of displaying, within a main container, 10 panels 147px sq that have background images positioned the opposite of the panel position within the container. When a user was to click one of these it grows over time so each edge of the panel reaches the relative edge of the container at the same time. Not difficult I thought, bit of jQuery animation - easy :) But unfortunately the animation function doesn't support the repositioning of background images because it has 2 values to deal with so I then stumbled accross the backgroundPosition plugin - fantastic! However this didn't work either as the background image 'shook' as the div grew and repositioned itself so I tackled the problem head on and wrote my own functions called at a certain interval based on the time/iteration variables and this is what I came up with: http://uts1.core.je/default.html. Exactly what I was after and I thought I'd share the wealth for you all as jQuery is an outstanding framework!! Feel free to use it should you find a use and if you have any time to dissect my code you'll see a lot of the calculations are using ternary operators to get the right value - there may be a easier/better mathematical solution and I'd love to see any ideas/solutions to this problem. Hope you like it! Cheers Rich
[jQuery] Dynamic form validation
Hi All, I tried a lots of way to validate a dynamic form. Validation is always works with the element ID right? Sometimes, it seems like the validation is working with the element NAME. I give you this example. [code=text] Dynamic Form Validation jQuery().ready(function(){ var jsonRules = { rules: { full_name: { required: true } } }; jQuery("#test_form").validate(eval(jsonRules)); var template = jQuery.format(jQuery("#template").val()); function addRow(){ jQuery(template(i++)).appendTo("#divPrimary"); var j = i-1; jQuery("#address_"+j).rules("add", "required"); } var i = 1; addRow(); jQuery("#add").click(addRow); }); Address: Name: Add More [/code] Here, if you notice, I have added the dynamic content inside the textarea. And the address has the fixed NAME(address). But the ID increments dynamically. Now, this dynamic form works perfectly when I increment the NAME like ID. If the validation is happening with the ID, then why I am not getting the validation? Hope to get your views. Thanks
RE: [jQuery] JQuery and ColdFusion
Did you ever get this worked out? Rick -Original Message- From: Westside [mailto:malik.robin...@gmail.com] Sent: Friday, November 20, 2009 2:29 AM To: jQuery (English) Subject: [jQuery] JQuery and ColdFusion Hi, I'm trying to use ColdFusion and JQuery but I'm having some problems setting/reading session variables. I have a login box that I use jquery to do the ajax work. In my ajax call I have this snippet $(form).ajaxSubmit({ type: 'POST', dataType: 'json', url: '/myapp/model/System.cfc?method=authenticate&returnFormat=json' success: function(resp, textStatus){ if(resp[0]==true){ window.location.href = 'index.cfm?fuseaction=myapp.home'; } }); So within System.cfc there is a method called "authenticate", in this method I'm trying to set some session variables (e.g, session.email, session.title) that I can reference once the user is logged in. So if the response from the ajax call returns true, the user gets redirected to this other page using window.location.href shown above. For some reason though, these session variables don't exist (session.email, session.title) when I try to cfdump them out on the 'index.cfm?fuseaction=myapp.home' page. I can dump them in the CFC and see that they are getting set correctly, but outside the CFC, they dont show up. Can anyone please shed some light on why I can't see my session variables? It mus thave something to do with calling the CFC directly or something Thanks
Re: [jQuery] Bolding a certain word - string manipulation?
I wouldn't know what to suggest about the IE7 problem without seeing the code in action. Do you have a test page I can look at? -Mike On Sun, Nov 22, 2009 at 4:45 PM, Rua wrote: > > Awesome thanks that works, but not in ie7? > > > Michael Geary-3 wrote: > > > > If the word "anything" is just part of the text inside the div, then it > > doesn't have a DOM element (tag) of its own. This means you can't select > > it > > with a jQuery selector or any kind of DOM manipulation, and you can't > > apply > > a CSS style to it. > > > > What you can do is rewrite the HTML content of your DIV element. > > > > If you know for sure that there is only a single DIV with > > class="tpSurveyQuestion", then it's simple: > > > > var $question = $('.tpSurveyQuestion'); > > $question.html( > > $question.html().replace( 'anything', 'anything' ) > > ); > > > > If there may be multiple DIVs that match that selector, you need to > handle > > each one individually: > > > > $('.tpSurveyQuestion').each( function() { > > var $question = $(this); > > $question.html( > > $question.html().replace( 'anything', 'anything' ) > > ); > > }); > > > > -Mike > > > > On Thu, Nov 19, 2009 at 3:18 PM, Rua wrote: > > > >> > >> Hi I'm trying to select a specific word inside a div and would like to > >> bold > >> it, I can't seem to find how to do this anywhere! > >> > >> $(".tpSurveyQuestion:contains('anything')").css("font-weight","bold"); > >> -- > >> View this message in context: > >> > http://old.nabble.com/Bolding-a-certain-word---string-manipulation--tp26421612s27240p26421612.html > >> Sent from the jQuery General Discussion mailing list archive at > >> Nabble.com. > >> > >> > > > > > > -- > View this message in context: > http://old.nabble.com/Bolding-a-certain-word---string-manipulation--tp26421612s27240p26471202.html > Sent from the jQuery General Discussion mailing list archive at Nabble.com. > >
[jQuery] Re: How to Hide Parent Div
You don't have to specify any params for parent(). Try this: $(this).parent().hide(); if that doesn't work, try changing using css $(this).parent().css('display', 'none'); Also check out jQuery UI (jqueryui.com), it has tabs and accordion elements already made and ready to use.
[jQuery] Re: (treeview) Collapsable hitarea
You have to unbind the click event on the span. Here's what I did: $("#categories").treeview().find('span.[your span class]').unbind ('click').click(); //replace [your span class] with the class of your nodes. By default they are 'folder' the +/- will still collapse and expand, but the label () will perform the action you specify. In addition to that, you can add your own function that will be executed when the user clicks on that node: $("#categories").treeview().find('span.[your span class]').unbind ('click').click(function(){ //add the action you want to happen when the user clicks on the node });
Re: [jQuery] Need to hide a href title content, but still need it available in the DOM
On Sun, Nov 22, 2009 at 7:40 PM, Dave wrote: > I want to disable the behavior of rolling over a link and having the > title content display. I realize that removeAttr will do it. But that > removes it form the DOM completely. And I will need it later. > > Is there a way to use disableDefault to just not display the tool tip > on roll over? I don't seem to be able to do it. You could remove the title and store the value in data, then reset it on hover out: $('a').hover( function() { $(this).data('title', $(this).attr('title')) .attr('title', ''); }, function() { $(this).attr('title', $(this).data('title')); } ); > Lemme know. It's kind of assumed that the person posting a question is looking for a response ;-)
[jQuery] Re: (treeview) Collapsable hitarea
The removes the click event from folders $("#treeview_id").treeview().find('span.folder').unbind('click'); If you want to add your own click event, here's how: $("#treeview_id").treeview().find('span.folder').unbind('click').click (function(){ //do something here });
Re: [jQuery] Add/Delete form elements
Oops--one change: /* create unique name & id */ newElem.children('input:first') .attr('name', 'foo') .attr('id', 'foo') .attr('value', ''); There's no sense giving it a name & id based on num because it may well be non-unique and that will be taken care of by renumberQuestions() later. On Sun, Nov 22, 2009 at 7:29 PM, brian wrote: > It looks the problem stems from non-unique IDs for your cloned > elements. So, the first thing to do is to get rid of those and use an > indexing method. > > > > > Title > > > > Question: /> > > > > > /> > > > > > > > $(function() > { > var num = $('.Question').size(); > > if (num == 1) $('.btnDel:first').attr('disabled', 'disabled'); > > /* ADD BUTTON > */ > $('#btnAdd').click(function() > { > /* clone 1st Question div > */ > var newElem = $('.Question:first').clone(); > > /* create unique name & id and remove value, if any > */ > newElem.children('input:first') > .attr('name', 'question_' + (num - 1)) > .attr('id', 'question_' + (num - 1)) > .attr('value', ''); > > /* place at end of list > */ > $('.Question:last').after(newElem); > > $('.btnDel').each(function() { $(this).attr('disabled','') }); > > /* limit number of available questions > */ > if (++num == 4) $('#btnAdd').attr('disabled', 'disabled'); > > renumberQuestions(); > }); > > /* DELETE BUTTON > */ > $('.btnDel').live('click', function() > { > if (num > 1) > { > $(this).parent('div').remove(); > > /* re-enable add button if necessary > */ > $('#btnAdd').attr('disabled', ''); > > /* decrement element count and disable delete button if > * just 1 remaining > */ > if (--num == 1) > { > $('.btnDel').each(function() { > $(this).attr('disabled','disabled') }); > } > renumberQuestions(); > } > }); > > /** > * Adjust id & name of question inputs. > * Because questions may be removed in any order > * adding a new one is not guaranteed to have a unique index. > */ > function renumberQuestions() > { > $('.Question').each(function(i) > { > $(this).children('input:first') > .attr('name', 'question_' + i) > .attr('id', 'question_' + i) > }); > } > }); > > Note the use of the live() function for the individual delete buttons. > This is because they may be added to the DOM dynamically. > > The renumberQuestions() function is the best i can come up with off > the top of my head (and with dinner needing to be cooked). There's > probably a more efficient solution. > > On Thu, Nov 19, 2009 at 4:37 PM, tomh88 wrote: >> Hi, >> >> I have two issues the following script. >> >> 1. The delete button will only delete the first form element. The rest >> of the delete buttons do nothing. >> 2. The add button adds a new element after the first one. I need it to >> add it at the end of the list (i.e. always last). >> >> The jquery is: >> >> //Add a new question >> >> $(document).ready(function() { >> var num = $('.clonedInput').size(); >> >> if (num == 1) >> $('.btnDel').attr('disabled','disabled'); >> >> //ADD BUTTON >> $('#btnAdd').click(function() { >> var num = $('.clonedInput').size(); >> >> var newElem = $('#input').clone(); >> >> newElem.children(':first'); >> $('#input').after(newElem); >> >> $('.btnDel').attr('disabled',''); >> >> //set number of available questions >> if (num == 4) >> $('#btnAdd').attr('disabled','disabled'); >> }); >> >> //DELETE BUTTON >> >> $(".btnDel").click(function(){ >> $(this).closest("div").remove() >> }) >> $('.btnDel').attr('disabled',''); >> >> }); >> >> }); >> >> And my markup is: >> >> >> >> >> >> Title >> >> >> >> Question: > id="question" /> >> >> >> >> >> >> >> >> >> >> Any help very much appr
Re: [jQuery] Bolding a certain word - string manipulation?
Awesome thanks that works, but not in ie7? Michael Geary-3 wrote: > > If the word "anything" is just part of the text inside the div, then it > doesn't have a DOM element (tag) of its own. This means you can't select > it > with a jQuery selector or any kind of DOM manipulation, and you can't > apply > a CSS style to it. > > What you can do is rewrite the HTML content of your DIV element. > > If you know for sure that there is only a single DIV with > class="tpSurveyQuestion", then it's simple: > > var $question = $('.tpSurveyQuestion'); > $question.html( > $question.html().replace( 'anything', 'anything' ) > ); > > If there may be multiple DIVs that match that selector, you need to handle > each one individually: > > $('.tpSurveyQuestion').each( function() { > var $question = $(this); > $question.html( > $question.html().replace( 'anything', 'anything' ) > ); > }); > > -Mike > > On Thu, Nov 19, 2009 at 3:18 PM, Rua wrote: > >> >> Hi I'm trying to select a specific word inside a div and would like to >> bold >> it, I can't seem to find how to do this anywhere! >> >> $(".tpSurveyQuestion:contains('anything')").css("font-weight","bold"); >> -- >> View this message in context: >> http://old.nabble.com/Bolding-a-certain-word---string-manipulation--tp26421612s27240p26421612.html >> Sent from the jQuery General Discussion mailing list archive at >> Nabble.com. >> >> > > -- View this message in context: http://old.nabble.com/Bolding-a-certain-word---string-manipulation--tp26421612s27240p26471202.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Need to hide a href title content, but still need it available in the DOM
I want to disable the behavior of rolling over a link and having the title content display. I realize that removeAttr will do it. But that removes it form the DOM completely. And I will need it later. Is there a way to use disableDefault to just not display the tool tip on roll over? I don't seem to be able to do it. Lemme know. Dave
[jQuery] Re: change the height of a div that is loaded after the jQuery is
It seems like the plugin Live jQuery might be a good answer. Any thoughts? Lemme know
Re: [jQuery] Add/Delete form elements
It looks the problem stems from non-unique IDs for your cloned elements. So, the first thing to do is to get rid of those and use an indexing method. Title Question: $(function() { var num = $('.Question').size(); if (num == 1) $('.btnDel:first').attr('disabled', 'disabled'); /* ADD BUTTON */ $('#btnAdd').click(function() { /* clone 1st Question div */ var newElem = $('.Question:first').clone(); /* create unique name & id and remove value, if any */ newElem.children('input:first') .attr('name', 'question_' + (num - 1)) .attr('id', 'question_' + (num - 1)) .attr('value', ''); /* place at end of list */ $('.Question:last').after(newElem); $('.btnDel').each(function() { $(this).attr('disabled','') }); /* limit number of available questions */ if (++num == 4) $('#btnAdd').attr('disabled', 'disabled'); renumberQuestions(); }); /* DELETE BUTTON */ $('.btnDel').live('click', function() { if (num > 1) { $(this).parent('div').remove(); /* re-enable add button if necessary */ $('#btnAdd').attr('disabled', ''); /* decrement element count and disable delete button if * just 1 remaining */ if (--num == 1) { $('.btnDel').each(function() { $(this).attr('disabled','disabled') }); } renumberQuestions(); } }); /** * Adjust id & name of question inputs. * Because questions may be removed in any order * adding a new one is not guaranteed to have a unique index. */ function renumberQuestions() { $('.Question').each(function(i) { $(this).children('input:first') .attr('name', 'question_' + i) .attr('id', 'question_' + i) }); } }); Note the use of the live() function for the individual delete buttons. This is because they may be added to the DOM dynamically. The renumberQuestions() function is the best i can come up with off the top of my head (and with dinner needing to be cooked). There's probably a more efficient solution. On Thu, Nov 19, 2009 at 4:37 PM, tomh88 wrote: > Hi, > > I have two issues the following script. > > 1. The delete button will only delete the first form element. The rest > of the delete buttons do nothing. > 2. The add button adds a new element after the first one. I need it to > add it at the end of the list (i.e. always last). > > The jquery is: > > //Add a new question > > $(document).ready(function() { > var num = $('.clonedInput').size(); > > if (num == 1) > $('.btnDel').attr('disabled','disabled'); > > //ADD BUTTON > $('#btnAdd').click(function() { > var num = $('.clonedInput').size(); > > var newElem = $('#input').clone(); > > newElem.children(':first'); > $('#input').after(newElem); > > $('.btnDel').attr('disabled',''); > > //set number of available questions > if (num == 4) > $('#btnAdd').attr('disabled','disabled'); > }); > > //DELETE BUTTON > > $(".btnDel").click(function(){ > $(this).closest("div").remove() > }) > $('.btnDel').attr('disabled',''); > > }); > > }); > > And my markup is: > > > > > > Title > > > > Question: id="question" /> > > > > > > > > > > Any help very much appreciated - I'm assuming the problems are > related. :) >
[jQuery] validate with changing default submit
I am a novice at jquery/javascript. I am trying to use validate plugin and then make a ajax request with post() and I am thoroughly confused by the submitHandler option Here's what I have: The html // many form elements here using validate plugin // where xxx.php is NOT what I want to have executed because I don't want a page refresh. The jquery stuff - $(document).ready(function(){ $('#mail_form').validate(); $('#mail_form').submit(function() { var formData = $('#mail_form').serialize(); $.post('mailer.php',formData,processResponse); function processResponse(data,status) { if(status='success') { $('#zone1').html(data); } else { $('#zone1').html('An error has occured.'); } } }); I want to execute mailer.php. I understand I should use the submitHandler: but I have no idea how to do it and retain the usage of serialize and post(). The documentation for this case says: $(".selector").validate({ submitHandler: function(form) { $(form).ajaxSubmit(); } }) but looking at the docs for ajaxSubmit seems to get orders of magnitude more complicated. Suggestions? Thanks. Mike
[jQuery] Re: jQuery Cycle Plugin and Captions - Please help!
Try this: after: function(curr, next, opts) { var alt = $(next).find('img').attr('alt'); $('#caption').html(alt); } On Nov 22, 12:12 am, Wroathe wrote: > You're on the right track!!! I added an alt attribute to the > first .featured-image and it displayed exactly where I wanted it!!! > The question is now how to select the img tag nested in it (in the > interest of writing valid xhtml). > > On Nov 21, 11:06 pm, Wroathe wrote: > > > I tried it and it didn't work Mike. I did a console.log of the alt > > variable afterwards and it was tossing undefined. I think this is > > because I have all of the slides wrapped in divs. I'm not sure how to > > remedy that problem. Is there a way of selecting the img's alt > > attribute using the code you just gave me? > > > Sorry. I was a designer before dabbling in development. I still have a > > lot to learn. > > > Thanks again! > > > On Nov 21, 10:58 pm, Wroathe wrote: > > > > I'll give that try and see how it works - thanks in advance for the > > > reply. I really appreciate it. > > > > On Nov 21, 7:01 pm, Mike Alsup wrote: > > > > > Try using the 'after' callback: > > > > > $(function() { > > > > $('div#slides').cycle({ > > > > timeout: 7000, > > > > pause: 1, > > > > pager: 'div#buttons', > > > > pagerAnchorBuilder: function(idx) { > > > > return '' + idx + ' > > > a>'; > > > > }, > > > > after: function(curr, next, opts) { > > > > var alt = $(next).attr('alt'); > > > > $('#caption').html(alt); > > > > } > > > > }); > > > > > }); > > > > > On Nov 21, 6:36 pm, Wroathe wrote: > > > > > > Hi there! I'm a little stuck and I was hoping someone could help me. > > > > > I've been trying to add captions to another div separate from the > > > > > slideshow and have them cycle with the slideshow and when the user > > > > > uses the pager. The one catch is I was hoping to use the images in the > > > > > slideshow's alt attributes as the captions. Here's the code, it'll do > > > > > a better job of explaining than I can. > > > > > > The JS is as follows: > > > > > $(function() { > > > > > $('div#slides').cycle({ > > > > > timeout: 7000, > > > > > pause: 1, > > > > > pager: 'div#buttons', > > > > > pagerAnchorBuilder: function(idx) { > > > > > return '' + idx + > > > > > ''; > > > > > } > > > > > }); > > > > > > }); > > > > > > The container I specified to contain the captions is > > > > > Pager anchors are here. > > > > > Alt attribute would go here. > > > > > > The slideshow div looks like this > > > > > > > > > > > > > > > src="images/image1.jpg" alt="This alt should be displayed as a caption > > > > > in #captions." height="300px" width="940px" /> > > > > > > > > > src="images/image2.jpg" alt="This alt should be displayed as a caption > > > > > in #captions." height="300px" width="940px" /> > > > > > > > > > src="images/image3.jpg" alt="This alt should be displayed as a caption > > > > > in #captions." height="300px" width="940px" /> > > > > > > > > > > > So I want the alts to become the captions and to change when the > > > > > slideshow auto-advances or when the user clicks on the appropriate > > > > > pager. > > > > > > Sorry, I'm a major noob :( > > > > > > Thanks in advance for any help! > >
[jQuery] How to Hide Parent Div
All, I am new to using jQuery, but have been playing with it this weekend and am stuck on one area which I have exhausted resources. I have an index.html page which has three Tabs inside a DIV container. The tab content is populated using Ajax and a seperate html file. Home NX Below this I have a jQuery Accordion menu..code below $(function(){$("#index_accordion").accordion({ header: "h3", active: false, collapsible: true, autoHeight: false });}); CAD Standards Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Meeting Minutes Phasellus mattis tincidunt nibh. Meeting Minutes 2 Nam dui erat, auctor a, dignissim quis. I would like to do this When a user clicks to view one of the other tabs (apart from HomeTab.html) I would like to hide the Accordion which is displayed on the home page. I have tried loads of syntax but cannot get anything to work. This is what I have at present at the top of the NXTab.html, but it does not work. $(function() {$(this).parent('div.index_accordion').hide(); }); Any help would be really appreciated. Andy
[jQuery] html method is inserting html as escaped markup (html source)
Hi All, I am having a problem with jquery's .html method (and also append, etc.). I am using the jquery form plugin to upload images, which is working fine. I am delivering a script response, which also works fine (.e.g. a javascript alert is sent back as a script response and works fine). But if I try to do html/dom manipulation it seems not to work correctly. The html string is inserted as an escaped string instead of html to be rendered by the browser. But it does insert that and render the string in the correct dom element, only it appears as html source. Here is the code I am using: $("#modal_content").append("Some html, tags should not be visible."); Does anyone know why this might be? On other ajax requests (not with uploads) the dom manipulation works as expected Thanks, Sean
[jQuery] Re: (treeview) Question/Request regarding toggle and links
$("#categories").treeview().find('span.[insert your node classname here]').unbind('click') if you want to add your own onclick event: $("#categories").treeview().find('span.[insert your node classname here]').unbind('click').click(function(){ //do something });
[jQuery] Add/Delete form elements
Hi, I have two issues the following script. 1. The delete button will only delete the first form element. The rest of the delete buttons do nothing. 2. The add button adds a new element after the first one. I need it to add it at the end of the list (i.e. always last). The jquery is: //Add a new question $(document).ready(function() { var num = $('.clonedInput').size(); if (num == 1) $('.btnDel').attr('disabled','disabled'); //ADD BUTTON $('#btnAdd').click(function() { var num = $('.clonedInput').size(); var newElem = $('#input').clone(); newElem.children(':first'); $('#input').after(newElem); $('.btnDel').attr('disabled',''); //set number of available questions if (num == 4) $('#btnAdd').attr('disabled','disabled'); }); //DELETE BUTTON $(".btnDel").click(function(){ $(this).closest("div").remove() }) $('.btnDel').attr('disabled',''); }); }); And my markup is: Title Question: Any help very much appreciated - I'm assuming the problems are related. :)
Re: [jQuery] How to Multiple wrap in Attribute level??
You can't split up a tag like that. Whatever you pass into functions like prepend(), append(), or html() will be treated (if possible) as a complete tag. It would help to know *exactly* what result you are looking for. I'm guessing you want to have it end up like this: Is that right? BTW, I assume that the extra ">" characters in the second and third tags is just a typo in your example, and your actual code is valid HTML? Here is how you could do it: $('table>td').each( function( i, td ) { var $td = $(td); $td.html( '' ); }); Also instead of 'table>td' as your selector, I'd suggest giving the table an id or class attribute and using that in the selector - otherwise your code will operate on *all* tables on your page. Finally, note that I switched your quotes around, using single quotes for JavaScript strings and double quotes for attributes. It will work either way, but valid HTML requires double quotes for attributes. It's worth getting in the habit of using single quotes for your JavaScript strings, so you can easily use double quotes for attributes inside those strings. -Mike On Sat, Nov 21, 2009 at 1:35 PM, navid zehi wrote: > hello all > > I have a problem with wraping a text or html with a tag, but the text > should be placed in an attribute . > > for example : > > i have a table like this > > >abc > >def > >ghe > > i want to change each of the TDs to Textbox with value of its TD . > > i used this : $('table td p').prepend(""); > > but the result acted as text and not HTML . > > plz someone help me , tnx >
[jQuery] theme switcher widget on ALL pages
Hi all, I would like on my web site one page where I can switch the themes (I did it) but I would like also that the new choice change the layout of ALL pages. For the time being the other pages don't change ! the cookie 'jquery-ui-theme' should help to do that ? All pages have the same header (meta + scripts + links + ...) All pages have the same footer.
[jQuery] Re: how to apply a class to a using $('#id').html()
Thanks guys, worked perfectly !
Re: [jQuery] Superfish - Multiple Columns
simplest case -- you can put just about any element into an LI, , floating your internal elements with 1/2 the width of the LI/UL they are in will make 2 columns Chris wrote: How would you use Superfish to make a dropdown menu that contains multiple columns of menu items?
Re: [jQuery] Why would jQuery be undefined in IE, but not FF???
Rick Faircloth schrieb: What could possibly be the issue? Your META are not closed: http://olaf-bosch.de/ http://ohorn.info/ http://www.akitafreund.de/ ---
Re: [jQuery] how to apply a class to a using $('#id').html()
Hi. how about this. for example onclick event. $('a').click(function(){ ??? ?? ? $('#status').addClass('avail').html(' ... '); }); Aom. Tristan wrote: Hello, i have in my script something like that $('#status').html('' + email + ' is OK'); instead of that i want to apply on my div status the class called 'avail' I know this is simple, but i'm stuck here. Thanks for helping me.
[jQuery] Re: how to apply a class to a using $('#id').html()
Assuming it's $("#status").addClass("avail").html("" + email + " is OK"); On Nov 22, 9:06 am, Tristan wrote: > Hello, i have in my script something like that > > $('#status').html(' width="16">' + email + ' is OK'); > > instead of that i want to apply on my div status the class called > 'avail' > > I know this is simple, but i'm stuck here. > > Thanks for helping me.
[jQuery] how to apply a class to a using $('#id').html()
Hello, i have in my script something like that $('#status').html('' + email + ' is OK'); instead of that i want to apply on my div status the class called 'avail' I know this is simple, but i'm stuck here. Thanks for helping me.
[jQuery] Qunit - ok(boolean)
Hi All how does this test work. I've copied the demo test page (http:// docs.jquery.com/QUnit) and played with this function, but whatever I do, it always prints 'test success': ok( true, "test success" ); ok( false, "test success" ); It should behave identical to assertTrue, so I expect only to see 'test success' when 'true' I'm sure there is no bug here, its me :), but what am I missing ? cheers LuCa
Re: [jQuery] Simple jQuery question
Julesfrog schrieb: Now my question. At this point, the button disappears only when the user hit the 500 mark. I would like it to disappear and stay invisible when the user reaches the 500 mark and anything below. I think it's got to do with this line: if(jQuery(this).scrollTop() != 500) but I just don't know the right "wording". Yes, is simple ;) Try this: if(jQuery(this).scrollTop() >= 500) -- Viele Grüße, Olaf --- olaf.bo...@t-online.de http://olaf-bosch.de/ http://ohorn.info/ http://www.akitafreund.de/ ---