javascript

How to split a loaded picture using greasemonkey?

I'm using FireFox. I want to split a picture into 3 parts and then display only middle part using greasemonkey. Can someone please help me out... Thank You ...

display image and script for a set period of time

This is very similar to a question I asked the other day but my page code has become significantly more complicated and I need to revisit it. I've been using the following code: $('#myLink').click(function() { $('#myImg').attr('src', 'newImg.jpg'); setTimeout(function() { $('#myImg').attr('src', 'oldImg.jpg'); }, 15000); }); To r...

Is it possible to lightbox many images but only show one image to activate them?

Hi, I'm using Lightbox to display photos. So If I have two categories of photos, "work" and "vacation", I would do... <a href="images/image-1.jpg" rel="lightbox[work]">image #1</a> <a href="images/image-2.jpg" rel="lightbox[work]">image #2</a> <a href="images/image-3.jpg" rel="lightbox[work]">image #3</a> <a href="images/image-4.jpg" ...

Using html5 localstorage to retrieve data from server, to allow editing of and appending to data source, then saving back to server.

So, I'm creating a standard user-data collection form that will be used by standard web browsers, as well as the iPhone and iPad. The app will allow users to create new records, as well as edit and delete existing records. I've gotten the gist of using html5's 'localstorage' to create a client-side data source and am looking for directi...

How do I tell which element a jquery click occurred on?

Hi, I am handling a click on a list item with jquery: $("#some_list li").click(function(event) { // magic happens here } The list items look like: <li><input type='checkbox'>Some text<span class='info'>(?)</span></li> I want to have different behaviours depending on whether the user clicks within the (?), or anywhere else ...

Changing a url depending on what link chosen (HTML) no asp.

TLDR I need to change a javascript variable on the same page after clicking a link (can be from a different page) so that the getjson request pulls different data without having to duplicate on html pages. I am using some getJSON requests with Jquery, to make calls to populate my pages. I want to be able to (in plain HTML / javascript...

How to disable cache in InternetExplorer 8

How can I disable cache in IE8 ? We are doing Javascript development and testing it in IE8, but we have to clear the cache every time we make changes to the Javascript files. ...

How do I dynamically instantiate a class in javascript?

I'm starting out with classes in Javascript and have hit a wall. I've looked all over for a tutorial that goes a little further than simply how to construct a class (usually Animal) then extend the class and have a Method do something (Dog alert('Bark');). I have created a class that I want a user to be able to instantiate (is that the ...

CSS window height problem with dynamic loaded css

Hi all: Please go here and use username "admin" and password "endlesscomic" (without wrapper quotes) to see the web app demo. Basically what I am trying to do is to incrementally integrate my work to this web app, say, every nightly, for the client to check the progress. Also, he would like to see, at the very beginning, a mockup about...

How is IE7 any better than IE6?

Oftentimes in the web development community, you hear people complaining about developing for IE6. However, if you are developing using a robust JavaScript framework like jQuery, is developing for IE6 any different than developing for IE7? ...

Segment text using fullstops

Hi I need to segment text using fullstops using PHP/Javascript.The problem is if I use "." to split text then abbreviations , date formatting (12.03.2010 ) or urls as well split-ed , which I need to prevent.There are many such possibilities , I might not be able to imagine. How to recognize that the "." is used as fullstop and nothing ...

Setting a cookie based on the name of the link that is clicked.

TLDR When clicking on a link I want to assign a cookie with a name of instrument and a value of the text on the link clicked. Using Jquery.1.4.2.min.js, Jquery.cookie.1.0.js I am trying to create a cookie when a link is clicked (will always link to "page.html"). name of instrument value of the TEXT So far I am trying to use: <scr...

Catch access to undefined property in JavaScript

The Spider-Monkey JavaScript engine implements the noSuchMethod callback function for JavaScript Objects. This function is called whenever JavaScript tries to execute an undefined method of an Object. I would like to set a callback function to an Object that will be called whenever an undefined property in the Object is accessed or ass...

Do I have to clean custom properties (Expandos) on window.onunload event?

Hi, In one article I have seen that it may be good to clear all expandos on window.unload event to prevent memory leaks. I cannot understand why to do this. Isn't the browser cleaning all the DOM and its relevant resources of it once you leave the page anyway? Thanks, burak ozdogan ...

Trying to get Italic font working with CUFON and Avenir Font

I tried everything. First, I did the standard thing - upload all 4 files (regular, bold, oblique, oblique bold). So. Avenir Light Avenir Bold Avenir Light Oblique Avenir Bold Oblique Note that I am using the "Light" version of Avenir as the Regular font. Anyhow.. after I installed this on my website (http://demo.brixwork.com/master...

Javascript if (j === null) do nothing.

Hi, I'm using CurvyCorners to make my corners curvy in IE, only thing is that when it reads the CSS it takes all the webkit properties and shows me an alert curvyCorners.alert("No object with ID " + arg + " exists yet.\nCall curvyCorners(settings, obj) when it is created.");. How can I just set this if statement to do nothing? if (j ==...

highlight the text of the DOM range element,

I am able to highlight the text on the HTML page(rendered through gtkmozembed), which is selected, like below. var range, sel; if (window.getSelection) { sel = window.getSelection(); if (sel.getRangeAt) { range = sel.getRangeAt(0); } document.designMode = "on"; if (range) { ...

How can I re-size and re-position a shadowbox/greybox window to display in a certain div element?

Hi guys, I would like to know if it is possible to re-size and re-position a greybox or shadowbox window to display in a certain div element? I am creating a template for a wordpress site, and I am using the default calendar, but when you click on a date inside of the calendar, the default action is to open it up in a new window. Would...

jQuery dynamic CSS loading weird behavior

The app I am working on requires dynamic loading of CSS and JS, right now the solution is as follows: myapp.loadCss = function(css){ $("head").append("<link>"); cssDom = $("head").children(":last"); cssDom.attr({rel: "stylesheet", type: "text/css", href: css }); ...

how to decode a string in a varible in javascript?

Hi, I have code in javascript: var location = '&quot;HCM - NYC (New York, NY)&quot;'; td_Details.innerText = location; Now I want to decode the text location to "HCM - NYC (New York, NY)" Please advice. Thanks. ...