JQuery :: Slight Tweak To Existing Function?
Dec 18, 2010I hope you can help tweak a jQuery function...
If you look at this "fiddle":[URL]... (it was written by a friend of mine, Addy Osmani...you probably know him!)
[Code]...
I hope you can help tweak a jQuery function...
If you look at this "fiddle":[URL]... (it was written by a friend of mine, Addy Osmani...you probably know him!)
[Code]...
I'm trying to tweak a small script to pull some data from an iTunes podcast formatted XML feed. Currently, it outputs a link to the most recent actual mp3 file with the episode title as the name (which is great), but I'd also like it to show a description of the episode under the link.Here's the code I have so far:
Code:
jQuery(
function($)
{[code].....
How can I tweak my existing code to output the content of the first <itunes:subtitle> entry under the link it generates?
A question for a jQuery expert. I'm more familiar with Prototype, but I've been using jQuery a lot recently and needed to find out how something is done, jQuery style Prototype has a rather handy wrap() function which lets you wrap an existing function within another function. It lets you attach code to be executed before or after an existing function is called.[URL]...
View 1 Replies View RelatedI'm a flash designer and new to jquery. I've a little experience customizing javascript for html, but for the most part this is new to me (and pretty frustrating, I must say). Glad there's a jquery forum and hopeful that I can get some pointers.
Here's my problem: I am using a terrific bit of jquery code for a custom pageflip effect, however if I put an html link on the same page, it doesn't work. I'm guessing that this has to do with the pageflip code designating the two corners of the "book" to function onClick, however I don't know how to get around this. Here's a link to the code I'm using: [URL]...s there a bit of jquery I can use for a link instead of the traditional HTML tags? Or is there some other way to add a link that won't be interfered with by the pageflip code?
I have a function I call to see if people leave form fields empty. I have been asked by a client to check to make sure of the person's date of birth as well. They gave me the script, however, I am unsure how to do implement it. How do I add this to my existing checks? Code:
View 2 Replies View RelatedI'm developing a table that'll have dropdown filters above it. However my table has a slight twist in that some columns will have more than one value in them, eg imagine a column with these values:
- UK
- UK
- UK, USA
- UK, Germany
- Germany
- USA
Now when I filter by 'UK' it should show four results - not two. Can anyone give me a few pointers how to do this or point me towards a plugin that might tackle this already? The values will always be comma separated.
I came across Marijn's helper function again called forEach. It does just what it sounds like it does, and is one of those things one would consider adding to their own personal little library like getElementsByClassName...My question is, I've heard/seen that Mozilla (and only Mozilla at this point) indeed HAVE a forEach function, and I do most of my beginning testing in a recent-stable Mozilla browser, so I'm not 100% sure but I think the Mozilla forEach might work... what happens if I write my own and I keep the name?
So if there's some default forEach that the browser natively understands, and then I have a function in my lib that has the same name, does mine take precedence over the native one, or not? Is it just safer giving libraries slightly weird names so new in-built functions can't possibly interfere?So also, if later browsers end up implementing the newer Javascript (2?) that as I hear, will implement a getElementsByClassName, would this break, or ignore, everyone's pre-made getElementsByClassName, assuming they are called the same name?
I'm using a script I've found that adds a bullet to links on a page:
<script type="text/javascript">
/***********************************************
* Bullet Link script- � Dynamic Drive DHTML code library (www.dynamicdrive.com)
[code]....
modifying an existing function which controls the highlighted states of a multi level js accordion menu. I have had to use javascript due to certain css elements not working in safari browsers.My problem is due to the multi level aspect as when a sub link is clicked, the parent link above it then deselects. I need the parent link to stay active when its sub links are clicked and only deselects when a link outside of that list is clicked upon.I understand the theory of adding a conditional statement but simply don't know how to apply it correctly within the functionHere is the existing function which tells a link to be active or selected:var Lst;
function CngClass(obj){
if (Lst) Lst.className='.topnav';
obj.className='selected';
[code]....
I have an existing JavaScript function that cycles through a bunch of colors depending on how many clicks of the mouse made.The all works fine, but I have since my code a little more complex, so now the colors are remembered once the user goes back to this page.. this is done with PHP and mySQL. The problem is that, once they go back the color may be red (2nd in the cycle), meaning next click they would expect to see orange, but the click counter is back to 0 so they actually see green.The code is:
Code:
<script type="text/javascript">
function countClicks (obj){
[code]....
I'm trying to add a unix timestamp into an exisiting function, but am uncertain how you add the variable. I searched the boards here, and came across this example to convert a date to unix in javascript. var date3 = new Date(Date.parse("21 May 2009 10:03:20")); And I'm trying to add it to this: flashobj3.addVariable ("targetTime", $date3);
View 2 Replies View RelatedI have got a bookmarklet for use with Opera which highlights all
occurrences of some text in the displayed page. I find it very
useful.
Sometimes I need to use two or three different colours for different
keywords I want highlighting on the same page. I have done this by
changing the original word 'yellow' for other javascript colour
words.
I know next to nothig about javascript. So I would ask if anyone
knows how I can tweak this javascript bookmarklet code (see below) in
two sepearte ways:
(1) So that I can select a color from a list. This may be as simple
as changing the caption to say "enter 1 for lime, 2 for yellow," etc.
or it might be cleverer.
(2) This is mutually exclusive with (1). In this case the
javascript would prompt me to enter a javascript colour keyword (like
"yellow" or colour code like "FF00FF").....
I would like to create a link from one page to another. Easy - I know. But I would like that link to to take me to a certain part of the other page, specifically towards the bottom of the page.
Is that possible to do? And if so, what are the different ways I can specify where in the page to go? (i.e. what are the parameters that I can play with)
if you take a look at this site here [URL] you can see that it no longer scrolls or even displays content, but here [URL] it does. I'll bet there's a quick fix here, but not sure what it is.
View 11 Replies View RelatedI noticed a slight usability bug with blockUI. when we block, with a message div - the page is still scrollable. however the message div that comes up, stays where it is, as user scrolls the page. So for example, if the vertical screen resolution is low, the user can not see the bottom of the message div, and in my case the message div has some appept or cancel buttons, which makes my UI unusable?
Are there any workarounds to this solution, other then placing the message div to the top of the page?
If you peruse my site here, you'll find that in IE8 (and maybe higher), the rotating banner at the top flashes the little thumbnails and the background a bit when visiting a new page. It doesn't do this in FF or Chrome Is there anything that can be done to fix this? I reviewed the documentation for the script and tried tinkering as much as I could, but can't get rid of the flashing.
View 1 Replies View RelatedI'm trying to validate a newly typed value in the textbox instead of the existing value it has when the page load, unfortunately, whenever I get the .val() I kept getting the existing value in the text box instead of the newly typed value.
[Code]...
Buenas noches dudes and dudettes,
I'm a total jquery noob, so this is probably very easy for you:
I've got a couple of selectboxes on my page, all with the IDselFunction1,selFunction2 and so on...
I want to create a new select box next to the preexisting selectbox if a certain value is selected, let's say "beaver".
How do i do this?
What makes this easy is I'm trying to replicate an existing website: BT's Personal Site
The menu of Packages / Phone, etc is very nice. Not only does the menu auto scroll, but also reacts to mouseover in a lovely manner (thereafter going back to auto scroll if there is no user input).
I've spent the afternoon going through all of JQuery's plugin library but I couldn't find something similar. I found individual scripts that I could use to mirror the auto rotate, but that meant integrating the rollover wouldn't work. Anyone got ideas on how to implement this?
A pre-existing script would be great if there is one(!) Otherwise, real simple advice as I'm a bit of a noob to jQuery. If there is no pre-existing script or the alterations will take a bit of effort, I'm happy to compensate if there is an expert for hire (depending on rates obviously!)
Let's say I have a Javascript object that looks like this:
{
events: {
"comments:added": this.add,
"comments:removed": this.remove,
"comments:fetched": this.addAll
}
}
I'd like to add this method to it, either manually, using $.extends() or _.extends():
[Code]...
When you click a link from a <li> list a div fades in on top of the list. When you click another link from the list I want previously faded in div to be replaced by new div. What I have now is all the links fades in randomly.[code]How should I change the code that does what I want. I have nine links on my list.
View 1 Replies View RelatedI am using tooltip in my application as a way to notify the user as to what kind of error was found in thier input field. My question is, once that error is resolved and validated correctly, is there a way i can remove the tooltip?
View 1 Replies View RelatedI have a function that generate code, create a tags and i want those a tags that onclick send the name attribute to and existing div in the page
so <div class="icon"></div> load with the page
<a href ... class ="marker"></a> are created manually
$(document).ready(function(){ $('a.marker').each( function() {
[code]....
Using the jQuery SVG plugin, is it possible to load a large .svg and then only draw certain parts on an as needed basis? For example, if you have an outline of all U.S. states but the user only wants to see a certain state. Taking their input, you draw just those lines that are needed.
If this is possible, please point me in the right direction or provide some example code. I am currently using: $('#fp').svg({loadURL: '../rockwell-working2-merged.svg'}); Which displays the entire svg.
I have a set of div elements cached inside var divs = $('#myDivs'). Suppose another div comes along that i want to add (push) to the group. is there a simple method for doing this without selecting ones already in the group for a second time?
View 3 Replies View RelatedI have two questions. I have a html page has two "data-role=page" objects. When I open that page by clicking on a link, the second page is displayed rather than the first. If I add "rel=external" in the link, the first page shows up but the back button is missing. Is there any way to ensure the first page shows up and the back button is visible.
The second, how can I call $("#pageObject").dialog(). I tried this on a link, nothing happens. Can't I use I<a href="#pageObject" data-rel="dialog">Open dialog</a>. This does not seem to work for internal pages. Is there a method to open internal pages as popups?