How do I select an <a> tag with by it's src?
How do I select an <a> tag with by it's src?
Changing src of two images on click
I want to swap the source of two images when you click on one image. Basically, I am switching on/off states. But I can't even get the first part to work. Here is a function that I would think replace the word "off" in the image file name with "on" when you click on an image with the class .img-swap. After that I would imagine I would toggle the class of each somehow. $(".img-swap").click(function () { $(this).attr("src").replace("-off", "-on"); });
Can someone help me with a lightbox please!
Hello, I work for a small non-profit and we are looking to add a lightbox to our homepage. I have no web design experience, although I'm in the process of learning HTML/CSS and then will move on to JS. That said, I can't figure out this lightbox. Right now, I have it where if someone clicks on the linked word, it'll pop up. However, I'm hoping to change two things. 1. I need it to pop up automatically when someone visits the page. 2. I really need to link the image someone else. The way it's set
Access to variable that is returned from the $.ajax "success" setting?
Hi, I am trying to access a variable that is return from the "success" setting from an $.ajax call. I am not sure how to do this. I have attached the code below. Maybe there i a different way to get this variable? $( function( $ ){ var xmlPath = '/site_media/xml/regions.xml'; var regionMap; function parseXml( xml ){ var map = {}; $( xml ) .find( 'region' ) .each( function(){ var regionName = $( this ).find( 'regionName' ).text(); var manager = $( this ).find( 'manager' ).text(); var phone = $( this
Jquery Cookie not working properly
Hi, I am developing a visualforce page and i am trying to expand and collapse the panel that has links to different pages. I used jQuery to expand and collapse the list. But when I expand the list and click on one item, the page gets refreshed and the list is collapsing as by default i am hiding the list. When user clicks on the list heading i am opening the list. The Jquery i am using is as follows: <script type="text/JavaScript" src="{!URLFOR($Resource.jQuery)}"></script> <script type="text/JavaScript">
Splitting data out of the name attr
I know this is probably super easy....but how does one extract var_1 & var_2 out of this? <input type="checkbox" name="checkbox[var_1][var_2]" />
no page refresh using juery and wordpress help
Hey I was wondering if some one could point me in the right direction. What I'm trying to achieve is blog page that will have no page refresh when you sort between categories. I found this tutorial and it works great in html and php, but when you go to you use it with wordpress only some of it actually works. The actual load function of the div #content is the only part that is not working for me. Like I said if anyone can point me in the right direction I would really appreciate it. Thanks in
Loading Stylesheets on the Fly, Font Preview
Hey Guys, Background: We are trying to integrate Google Fonts into an interface we are developing; where users will choose a font, and then get a quick preview of the font. With Google, you need to load in a stylesheet for the fonts... so we would need to change this whenever the user selects a different font. Question: Is is possible to load in a stylesheet on the fly with JS and have the changes be visible to users instantly? Andrew
Slow script errors caused by jQuery.fn.extend.find
I have a form that is dynamically constructed using JSP. It creates a spreadsheet-like table where the user associates a row with a column by clicking a radio button. It's possible that there may be up to 400 rows and 50 columns, making the table unwieldy. (For example, the row and column headings disappear when the user scrolls down or to the right.) Our solution was to create a tooltip on each radio button to identify the row and the column of that radio button. It works great for a small
process body onload event for multiple iframes on html page
I have an html page with several iframes on it. The iframes all load a particular javascript file called main.js. In that javascript file, there is a function X. How can I through code written in the main.js file cause function X to be called upon the body onload event of each iframe? Some of the body elements in the iframes already have a onload function specified in the <body> tag in their html file. I would like this function X to be called in addition to any such specified functions in the file.
.change is not being detected from select in table cell
I added a test script to detect the change of a html select object and it is not firing. The select is within a table row. The table id is: flogtable and the select is in the first row. The test function I added is: $('.symselect').change(function() { alert('Handler for .change() called.'); }); What am I missing?
Element beforeunload
hi all, Can u tell me is it possible for when am unload the div i want confirm message .its should be common method. ex: $('#divid').load('test.php'); <div id="divid" >some message </div> here before replace the content .i want cofirm message alert("you want replace the content'); by M.Maheshrajkumar
Accessing JSON
All, Very very new to jQuery, so forgive me in advance if this is a simple question. I'm trying to build a single page web app using jQuery, jQTouch and, obviously, HTML. Right now, at a stage where I'd like to pull in content from a Wordpress site. I have been reading up and playing with the capabilities of jQuery to accomplish this, and I've been able to work through some of the examples, but I'm having a hard time getting this to work for my specific feed. I'm using the code below -- trying,
How to get the Offset for content of the tranperent image
Hi all, I am having an transparent image and that image having image content at the right most corner of the image. Is there any way to get the offset of the image content(Actual content of the image) in Jquery. Please help me.Thanks
dont detect new element prepend by jquery
Hi, im starting with jquery and im trying to prepend a li to my ul list $.ajax({ type: "POST", url: "gethtml.php", cache: false, data: { id : $('#input_id').val() }, success: function(html){ $("ul#list").prepend(html); $("ul#list li").show(); }, error:function(XMLHttpRequest,textStatus,errorThrown) { alert(textStatus); } }); this html would be like ... <li><a href="#" id="1">Link</a></li> then i wil try to do this function when click on this links $("a").click(function(){ alert( $(this).attr('id')
redirect by $ajax
hello...am using .net with jquery and I am trying to redirect from a wcf restful service ,but I am having a problem that the status code is returned 200 while it shall be 301 or 302 so it's not redirecting , plus...on IE9 it's working but mozilla , chrome , safari are giving me parser error , here is my code : function Activate(e) { debugger; e.preventDefault(); var activationCode = $("[id$='_inputTxtActivationCode']").val(); if (activationCode ==
Any way to detect 404 on ajax where dataType === script?
As specifically stated in the documentation, the error handlers are not called when a cross domain script or jsnop call fails (actually they sometimes are, given a url of "foo" the error handler is called, given a url of "http://www.foo.com/foo.js" they are not) Is there any way for me to detect a 404 (other then perhaps assuming after some number of seconds that if success hasnt been called that an error occured)? Thanks Stephen
Sending data to server issue
Hi, I have a script which lets me take data from an XML page, and displays it on a form. To do this I use: $(function(){ $('#results').hide(); $("td[id^='weekcommencing_']").click(function() { var week = $(this).text(); var url = "xml-data.php"; $.get(url, { week: week, store_number: 32492 }, fillinform); }); }); function fillinform(week) { xmlDoc = $.parseXML( week ); xml = $( xmlDoc ); $('#daily_sales').val(xml.find('daily_sales').text() ); $('#projected_sales').val(xml.find('projected_sales').text()
Getting value of embeded select on button click
I have a select inside of a table cell and when the user clicks the form Update button I need to get the value of the selected option and pass it to a php var for inclusion in the passed values to the next routine. The retrieval of the selected value could also take place when the selected option is changed. Any help will be appreciated. The select has a class of 'symselect' assigned. Thanks for your help. Bill S.
Lots of warnings with jQuery 1.5
Why does jQuery 1.5 shows so many warnings in Firefox's Error console? Warnings about: Functions not always return values? Test for equality (==) mistyped as assignment (=)? Reference to undefined prototype? Reference to undefined property? This makes a quick debug using the error console a nightmare and to be honest shows problems with the code. Clean code doesn't show warnings to avoid introduction of errors later on. If warnings are accepted only to make the code smaller, that's a very bad approach.
ajax script redirect
Hi , I am using an ajax call when clicked on a link... It asks whether you want to continue or not and if you say "ok" then it uses a perl script to delete something from the db... lets imagine it this way: +--------+ | name | LINK_COLUMN +--------+ | Brad | LINK_to_delete_brad | Paul | LINK_to_delete_paul.. | Josh | ... | John | ... | asdfas | ... +--------+ =>So I was able to call confirm on each of those links and if agreed use an ajax call to a perl script to wipe the user from database.
List pagination
Hi, I've got some problem. There's a list in HTML like this: <div class="list"> <a href="http://www.domain.com/alias/category/product/a01">A01</a><br /> <a href="http://www.domain.com/alias/category/product/a02"A02></a><br /> <a href="http://www.domain.com/alias/category/product/b01"></a>Basfasdf<br /> <a href="http://www.domain.com/alias/category/product/bcdsdfa"></a>Bcdsdfa<br /> <a href="http://www.domain.com/alias/category/product/hasfas">Hasfas</a><br /> <a href="http://www.domain.com/alias/category/product/wasda">Wasda</a><br
JQuery validate and UI dialog
Hi, I have several Jquery UI dialogs on my page. What I want to know is, is it possible to use jquery.validate to validate these separately? jquery validate validates the whole form, so would this prevent me from doing this?
[SOLVED] slideUp/Down working but not sliding
I'm trying to use slideUp and slideDown, they seem to be working in terms of being Up and Down but there is no sliding between these states, any ideas? My CSS: #sub-nav{ width:240px; min-height:240px; padding:0; background:url(../images/80-opacity-bg-fill-purple.png) repeat; overflow:hidden; position:relative; z-index:4; display:none;} .sub-nav{margin:0; padding:20px 0;} .sub-nav > li{ border-bottom:1px dotted #fff; width:200px; margin:0 0 0 20px; list-style:none; font-family:Tahoma, Geneva, sans-serif;
call common method in jquery
hi, If am click any events my common method should be call initially.using jquey pls let me know by M.Maheshrajkumar
How do I freez 2 column and 2 row using jquery.sheet.js
Hi, Kindly help to find out the way to use jquery.sheet to freez first 2 column and 2 row from top. I am finding difficulties to do so. Please help me out.
jquery popup
Hi, In my project i have the popup.i am loading the popup with gridview . gridview having dropdown after selected value change of dropdown i have to load the selected value details. Now the problem is when i select the value in drop down the popup will be disable. because am selecting the value from database with the select...
[jQuery] Best plugin for modal dialogs
Hi, There are so many plugins for modal dialogs that I don't know which one should I use and/or which one is the best... I mean, if there was only one plugin of this type including all the features from all the modal plugins, that would be cool. Which one do you think it's the best and why? Care to state the pros and cons of each plugin (or the ones you know/have already tested)? That would be nice...
[jQuery] new plugin, gzoom v.0.1 magnifier
Hi, I wrote my first plugin, you can find it here: http://lab.gianiaz.com/jquery/gzoom/ Please report any bugs or consideration about it here... but be kind... I'm a newbie :-) Bye -- gianiaz.net - web solutions via piedo, 58 - 23020 tresivio (so) - italy +39 347 7196482
Transparent PNG shows black edges in IE8
I created a button with 2 states for mouse-over effects using css sprites. This has always worked well and I have no issues. I recently added some jquery to my buttons to create a smooth transition for the mouse over and this is where I see the issue. When the page is initially loaded the image looks fine. When I hover over the image there is a brief flash of black around the transparent edges then the transition begins and everything looks okay. When I un-hover the image shows the black edges. From
[jQuery] Is local javascript evaluation possible, instead of globalEval?
I'm writing an Ubiquity command and I want to pull in some remote HTML/ Javascript. The code I currently have is like so: var doc = CmdUtils.getDocument(); var url = "http://my-remote-url"; jQuery.get(url, function(data) { jQuery(doc.body).append(data); }); The problem is that the javascript within data gets evaluated within the global scope (using jQuery.globalEval), but the CmdUtils object isn't available in the global scope and I'd like to be able to
[jQuery] Why globalEval?
I was just reading through some of the jQuery code again to better learn its internals, and I'm not sure why the globalEval function exists in its current form. Whenever I want to eval something in the global context, I always do: Function(data)(); since the Function constructor doesn't create a closure. This seems much simpler than the current logic, expecially for Safari - but I admit that I haven't done much cross-browser checking. Do some browsers not support the above syntax, or is there
Live Text Update and Auto Resize
Is there a plugin that will do this? Or does anyone have an idea about how to implement something like this? The idea is for a sign company to have customers customize the text for their signs. They want to allow users to input text and have it update the sign image live with the text and resize it if the text string get's too long. Any ideas or thoughts or suggestions? Thanks a million.
[jQuery] Accordion initial state after page changes
Hello, I'm stuck with a simple jquery accordion script that is http://www.stevekrueger.com/jquery-accordion-tutorial/. The problem is that there are links inside my divs that brings to another page where the same accordion menu should be included and left opened at the same state like the previous page (hope to be enough clear... ). The script I'm using will always close all the accordion divs upon the second page load. I'm a total newbie of jquery and couldn't understand exactly how jquery works
[jQuery] Superfish skins...
Hi all, I am new to jquery and superfish, but I am liking what I see. I am wondering if there is a repository of superfish skins to obtain new looks. The demo is making sense, but I see the site www.sharevault.com uses superfish and has a different menu look. I assume the different look is controlled only by the css file. Is there a source for obtaining different looks - it would make sense for everyone to take advantage of the more creative ones out there. Thanks, Phil
[jQuery] [Cycle] opts.slideCount Problem
a fast question : how to use the opts.slideCount ? function onAfter(curr, next, opts){ var msg = ' ' + ( opts.currSlide + 1) + ' / ' + (opts.slideCount); $('#counterMedia').html(msg); }; seems not working easily : the result in the #counterMedia is : 2 / undefined the opts.currentSlide works well but the opts.slideCount not
[jQuery] How to FCKeditor create and destroy on fly?
Hi All! Have a problem with correctly unload (destroy) FCKeditor object from DOM, created through $.fck() plugin? I wana edit HTML content on fly. Double click to content block is called FCKeditor through you plugin. Button "Save" is post data to action.php script. I want use Ajax for avoid reload page. Can I make button "Cancel" that make unload FCKeditor from DOM on fly. I tryed use $.remove() method, but any next call .fck() is failed. P.S. Sorry for my bad english.
[jQuery] Validation plug-in - how to set russian messages for all
Hi, I'm using validation plug-in in our application for customers from Russia. I need to set russian messages for all customers from all places in the world. How can i do that? Messages are in "localzation/ messages_ru.js". Regards Mateusz Wolsza
backgroundPosition issue in IE8
I need help with an IE8 problem. I apologize for the long post but I want to give as many facts as possible. Please reference: www.banana-digital.com I have already banned less than IE8 from my site but have the following problem with IE8 only (works on Mac and Win in these "allowed" browsers: Safari 5+, Chrome, FF 3.5+ and Opera 10+): var element = $("#whatever"); var showOverClosed = "0px -13800px"; element.css({backgroundPosition: showOverClosed}); I use the backgroundPosition setter / getter
jquery click commands on dynamic html
hi. i am dynamically adding html to my page using the .html(...) function which is triggered based on some user action. i have also defined a click function specific to some id tags that is in the dynamic html. when i generate the dynamic html and call the click function, nothing happens (aka, the click function is not getting called...) what could be the problem? i have attached the code below: following html code called upon a user action, which adds a button on the page with id = addTask: .html("<input
Next Page