JQuery :: Limited Jqueryui External Css References?
Aug 11, 2009
I'm working on a project that I want the user to be able to change the color theme of the site. For some reason if I go over about 20 themes or css references it breaks the site. Any idea why this is? if so, how can I get it to accept say 50 themes?
View 2 Replies
ADVERTISEMENT
Dec 26, 2010
I have a page where the SuperFish menu needs to open over a few elements that are grouped together by a jqueryui accordion. It works great in all relevant browses except IE8 in compatibility mode (which, afaik is like ie7, no?). In those "not so great cases" the SuperFish menu is displayed UNDER the accordion instead of above it I tried playing around with z-index but to no avail
View 1 Replies
View Related
Nov 1, 2011
I have successfully implemented the jquery cycle plugin, but on some machines we see poor performance. We are trying to implement the lite version and perform other optimizations in an effort to improve performance on older machines. Many functions of the cycle plugin we can go without, but one important feature is the ability to run a function once the cycle is finished. We accomplish this via "nowrap" and "end" without issue using the full plugin, but I believe these options to be missing from the lite as the function does not execute upon cycle end.
The first part of this topic is to determine (since there is no list of features available in the lite versus full) that the nowrap/end are not available in lite.If they are not available, we would like assistance in performing a simple function to redirect the user when the cycle ends. We are using the cycle plugin to create a "splash" page and we want the page to auto-redirect to the main page upon completion. The "end" function did this perfectly, so what options do we have to redirect the user without the "end" function?
View 1 Replies
View Related
Sep 19, 2010
My site's working perfectly in the other browsers, and when I delete line 28 (see below) it works in IE but not exactly how I want. Is there a way to retain two jquery references on a single page in IE?
This is the head section of my code:
View 3 Replies
View Related
Aug 28, 2003
i am using cbe 4.19 to create a div to show some help.
onclick=myShowDIV(myTopic, myContent_iamverylarge)
the parameter myContent can be very large (more than 6000 characters)
i noticed that if its more than about 4000 chars, opera doesnt show the DIV anymore (using Opera 7.11)
IE and Netscape dont have this problem.
any ideas?
View 2 Replies
View Related
Jul 16, 2009
I'm trying to use google maps for the web application I'm developping. The idea is I have a database with all the universities with whom we exchange. I know where each university is (city). What I want to do is show all the cities on a google map (as markers)Here is the code I am using:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">[code].....
The code works well, it finds the cities and places a marker at the appropriate place. BUT, only 18 out of the 73 cities are shown. If I take away some cities from the list, the others are found. All the cities can be found this way, but only up to 18 appear at a time. how to avoid having this limit?
View 2 Replies
View Related
Sep 16, 2011
1 Box holds 3 items, Complete box weighs 75g, each item 25g, customer chooses their own 3 combo items. This could be the same all the same item or 3 different items.
I need a script that will require the selections to make up 75g in order to continue the process. i.e customer can only continue when 3 items / 75g worth are selected.
Here is a short version, I have about 12 selectors at the moment and possible more will be created (if that matters).
<form name="cart_quantity" action="myProduct?action=add_product" method="post" enctype="multipart/form-data">
<
<div class="placeholder">
[Code]....
The section of the form is just the portion with selctors, there are other fields with radio buttons for color choice etc.
View 3 Replies
View Related
Aug 24, 2002
<html><head>
<script>
evil = false;
if(document.layers){
evil = true;
}
created = new Array();
logotext = new Array();
//Your text here
logotext[0] = " * * ";
logotext[1] = " * * * * ";
logotext[2] = " * * * **** *** *** * *** **** ***** *** *** * * ***** ";
logotext[3] = " * * * * * * * * * * * * * * * * * * * * * * ";
logotext[4] = " * * * * **** * * * * ***** * * * * ***** * * ";
logotext[5] = " * ******* * * * * * * * * * * * * * * * * ";
logotext[6] = " ************* * * *** *** **** **** *** * * **** * * *** ";
logox = 100;
logoy = 100;
logocolor = "lightgrey";
//STOP EDITING!!!
for(i=0;i<logotext.length;i++){
logotext[i] = logotext[i].split("");
}
var logo = "";
if(!evil)
logo += "<div style='position:absolute; top:" + logoy+ "; left:" + logox + ";'>";
if(evil)
logo += "<layer top='" + logoy + "' left='" + logox + "'>";
for(i=0;i<logotext.length;i++){
for(a=0;a<logotext[i].length;a++){
if(logotext[i][a]!=" "){
logoy = i*5;
logox = a*5;
if(!evil){
id = "JT"+i+"x"+a;
logo += "<div id='" + id + "'style="position:absolute; visibility: hidden; width:3px; height:3px; top:" + logoy+ "px; left:" + logox + "px; overflow:hidden; background-color:" + logocolor + ";" onclick='alert("" + id + "")'></div>
";
created[created.length] = id;
}
if(evil)
logo += "<LAYER width=Ɖ' height=Ɖ' top='" + logoy+ "' left='" + logox + "' bgcolor='" + logocolor + "'></LAYER>
";
}
}
}
if(!evil)
logo += "</div>";
if(evil)
logo += "</layer>";
var Seed = 999;
function random(max) {
var d = (new Date()).getTime();
Seed = (d * Math.abs(Math.cos(Seed)));
return Math.floor(Seed) % max;
}
created2 = created;
created = created.toString();
function anilogo(style,ati,whendone){
if(document.getElementById&&created2.length>0){
for(i=0;i<10;i++){
rannum = random(created2.length)
newone = created2[rannum]+"";
if(created2.length>0)
eval("document.getElementById('"+newone+"').style."+style+" = '"+ati+"'");
if(window.createPopup || (navigator.appName.indexOf('Netscape')!=-1))
created2.splice(rannum,1);
}
}
if(created2.length<1){
clearInterval(start);
eval(whendone);
}
}
function stage1(){
start = setInterval("anilogo('visibility','visible','stage2()')",100);
}
function stage2(){
created2 = created.split(",");
start = setInterval("anilogo('background','black','stage3()')",100);
}
function stage3(){
created2 = created.split(",");
start = setInterval("anilogo('background','green','stage4()')",100);
}
function stage4(){
created2 = created.split(",");
start = setInterval("anilogo('visibility','hidden','')",100);
}
</script></head>
<body onload="stage1();">
<script>
document.write(logo);
</script>
</div>
</body></html>
logotext[X]
Is where one line of the logo goes.
logox = 100;
logoy = 100;
the x and y cord of where you want the logo to be
logocolor = "lightgrey";
the color of the logo
function stage1(){
start = setInterval("anilogo('visibility','visible','stage2()')",100);
}
function stage2(){
created2 = created.split(",");
start = setInterval("anilogo('background','black','stage3()')",100);
}
function stage3(){
created2 = created.split(",");
start = setInterval("anilogo('background','green','stage4()')",100);
}
function stage4(){
created2 = created.split(",");
start = setInterval("anilogo('visibility','hidden','')",100);
}
this is where the animation stuff is controled. If you want it should be pretty easy to figure out. Otherwise I will look through it later and figure it out...
View 1 Replies
View Related
Jul 26, 2010
A UI built using HTML and CSS has limited screen space. One of the elements is a div tag (<div id="mtext">) that will contain text of variable length. If the text is > 500 characters, I am displaying it as a link. When the user clicks the link, I want the text to be displayed in a layer above all the rest of the elements in the page. How can this be done using javascript..
Code:
A div element that contains some text of variable length. If the length exceeds say 500 characters, Display it as truncated text. ( like "Example text...") The entire truncated text becomes a link When the user clicks the link the content in the div element "pops out" to fill the screen above other elements on the page Image showing truncated text... (before clicking) Image showing text display after clicking the text...
View 2 Replies
View Related
Jul 23, 2005
Is it true that Javascript has no clone() method, to pass an object by copy of value instead of reference?
If I have an object and want to make an array out of all of its instance variables, I can loop through it and pass its values to a new array, and the class instances will be passed by copy and not by reference?
Example 9.3: References Themselves Are Passed by Value
// This is another version of the add_to_totals() function. It doesn't
// work, through, because instead of changing the array itself, it
tries to
// change the reference to the array.
function add_to_totals2(totals, x)
{
newtotals = new Array(3);
newtotals[0] = totals[0] + x;
newtotals[1] = totals[1] + x;
newtotals[2] = totals[2] + x;
totals = newtotals; // this line has no effect outside of the
function.
}
Note that this rule applies not only to pass-by-reference, but also copy-by-reference. You can modify an object through a copy of a reference, but changing the copied reference itself does not affect the object nor the original reference to the object. This is a more intuitive and less confusing case, so we don't illustrate it with an example.
View 5 Replies
View Related
Oct 23, 2005
I'm currently engaged on a dissertation which is
investigating AJAX technologies and I was
wondering if anyone had any references that might
shed light on the subject?
I will of course carry out a literature review but
in the mean-time has anyone any (preferably print
based) sources of data on AJAX?
View 9 Replies
View Related
Dec 17, 2005
I am a bit new to JavaScript objects, I have the following object:
LinkTest=function() {
// init
}
LinkTest.prototype.eventHandler=function(){
// the call below fails, as 'this' refers to the link that
// generated the event, and not the instance of LinkTest object
this.doSomething();
}
LinkTest.prototype.register=function(link){
link.onclick = this.eventHandler;
}
LinkTest.prototype.doSomething=function() {
// do something!
}
So basically when you register a link, the onclick event handler gets a reference to LinkTest's eventHandler function. Now when the user clicks on the link, the 'this' refers to the link... how do I reference the instance of LinkTest object from within the eventHandler function?
View 2 Replies
View Related
Jul 20, 2005
I discover a strange bug in Konqueror 3.1.1.
I design a javascript application which acts in one file called
example.html. At the beggining of this js i write:
if (document.images)
{
folderopen= new Image(16,16);
folderopen.src="http://www.sergioamo.8m.com/buttons/folder_open.png";
folderclose= new Image(16,16);
folderclose.src="http://www.sergioamo.8m.com/buttons/folder_close.png";
}
functions....
....
...
..
and my javascript works perfect.
If i write:
if (document.images)
{
folderopen= new Image(16,16);
folderopen.src="./buttons/folder_open.png";
folderclose= new Image(16,16);
folderclose.src="./buttons/folder_close.png";
}
functions...
....
...
..
my javascript does not work properly. Does anyone knows if is imposible
to use relative references with konqueror 3.1.1 or which is the problem?
View 2 Replies
View Related
Jul 20, 2005
Apparently, there is a page with multiple frames, where one of the
frames is a "hidden" frame, and is there just to contain one or more
"fields" that are referenced from other frames.
Supposedly, if a user "sits" somewhere in this set of pages for
several minutes and then tries to do something, the page redisplays,
but an inter-frame reference (to the "hidden" frame) fails with some
sort of a "No permission" error. If the user navigates through the
site with no real delay, they don't see this problem. This is the
situation I need to understand.
I'm assuming that the "No permission" error occurs when a frame that
was obtained from domain "foo" tries to reference a frame that was
obtained from domain "bar" (I'm not sure of the correct terms in the
context of JavaScript). Under normal operation, all of the frame
contents are obtained from the same domain (I believe).
My theory is (without much information yet) that there must be a
proxy/cache server in between. When the user navigates through the
site with no delays, all of the frames are obtained from the same
server (either the cache server or the target server, I don't know
which). However, when the user "sits" for a while, I'm guessing that
the cache server hits a content timeout, and a redisplay of the page
causes one frame to be obtained from the target server, and one from
the cache server.
Does this seem like a reasonable explanation for what we might be
seeing? What are useful strategies for fixing a problem like this?
View 1 Replies
View Related
Mar 9, 2003
I am trying to make a function that checks/unchecks a checkbox when a specific <td> is clicked. I need to use this same function for several checkboxes in the page so I want to just pass it the name of the checkbox I want to affect as a variable and use it in the object reference lines. BUT, this doesn't work. I can pass the variable to the function as I've used alert(variable) to test this. But it doesn't work when I put it in a line like this "document.forms[0].variable.checked=true;". Code:
View 4 Replies
View Related
Dec 5, 2010
is there a way to shorten something like:document.scoresheet["HomeTotalHCaps"].valueto a simple short name like var1.value ?
View 8 Replies
View Related
Feb 27, 2007
THE QUESTION: How do I get a reference to my Object when processing an
event handler bound to an html element ?
CONTEXT:
Sorry if it is a bit long.
I am developing a JS calendar tool. One of the requirements is that the
calendar will need to display a varying number of months (1..3)
depending on the calling page. Imagine 1, 2 or 3 calendar pages side by
side as required.
I have built a grid object that will contain one month's dates with the
day names at the top. The calendar object inherits the grid object as an
array of "calendar pages" - one grid per month and the calendar provides
the content for each grid. I will use the grid object for another
completely different object later and so I want to use good OOP
encapsulation. The grid is a table generated on the fly and is "dumb" as
far as what it is used for.
I have attached an onlick event to each cell of the grid. Using OOP
priciples I want the calling program (the calendar object in this case)
to provide a function to handle the click and the grid object will
provide to the calendar the row and column of that cell as well as the
grid number (so the calendar can work out which date was clicked since
it knows what the data means and the grid doesnt). Code:
View 6 Replies
View Related
Aug 22, 2010
I have some confusion about the scripts below:
1) is getRule a local variable or global variable, as it has no var keyword, yet it is an inner function of Validation? So without var, I think global, but being an inner function, I think local. So I'm not sure which.
2) In this line of code: var rule = $.Validation.getRule(types[type]), getRule returns rules, which is just a local variable in Validation. I always see that you return functions, but how does returning a local variable that's just an object literal and not a function be able to return true or false? Now the value of rules is an object literal, and this object returns true or false. So we are basically allowed to use return keyword with local variables that are object literals and not functions?
3) In this line, is foo(age) being called, or is it just being assigned to bar OR is it being called and THEN assigned to bar: var bar = foo(age);
4) Now for the most confusing: age is obviously an object reference as opposed to a literal in the example. Does that make a difference in regards to closures?
Note that I read a number of books, including JavaScript Programmer Reference and Object Oriented JavaScript and jQuery cookbook, which compare primitives vs reference types and how primitive types store directly in memory whereas reference tpyes reference memory, so if one reference changes, they all change where primitive remains ingrained. But when assigning a function as a reference like this, how does that affect the object "age" when passed into bar?
Code:
(function($) {
/*Validation Singleton*/
var Validation = function() {
var rules = {
email : {
check: function(value) {
if(value)
return testPattern(value,".+@.+..+");
return true;
}, .....
$.Validation = new Validation();
})(jQuery);
Code:
function foo(x) {
var tmp = 3;
return function (y) {
alert(x + y + tmp);
x.memb = x.memb ? x.memb + 1 : 1;
alert(x.memb);
}}
var age = new Number(2);
var bar = foo(age); // bar is now a closure referencing age.
bar(10);
View 3 Replies
View Related
Sep 20, 2006
I've spent several days trying to work this out. Maybe I'm just
searching for the wrong keywords/phrases.
I have some code that looks like:
[-- snippet starts --]
Console = new Object();
Console.init = function() {
this.STDIN = document.getElementById('console0_stdin');
this.STDOUT = document.getElementById('console0_stdout');
// set styles on the element references, eg:
this.STDIN.style.width = ļ`%'
this.STDOUT.style.width = ļ`%'
}
Console.focus = function() {
this.STDIN.focus();
}
Console.writeln = function(buffer) {
this.STDOUT.value += "
" + buffer;
}
[-- snippet ends --]
I'm not sure why, but the Console.focus() and Console.writeln() methods
just don't seem to be able to use the DOM references stored in
Console.STDIN and Console.STDOUT. Everything's fine in the
constructor, but other methods can't seem to use them.
View 8 Replies
View Related
Jan 29, 2009
Is it possible to test whether two objects are equal using the data they contain inside and not comparing their pointers with ==?
Well actually of course there is but...
Is there a way to do it without actually looping through the object, instead maybe something that came with JS? (something like a .equals() method from other programming languages.)
View 5 Replies
View Related
Oct 16, 2010
I am confused about the true difference between the two below examples.
first example:
// Demonstrating a problem with closures and loops
var myArray = [āAppleā, āCarā, āTreeā, āCastleā];
var closureArray = new Array();
[code]....
Here we iterate through the length of myArray, assigning the current index of myArray to theItem variable. We declare closureArray 4 times as an anonymous function. The anonymous function in turn declares the predefined write() function, which is passed parameters. Since write() is in closureArray() a closure is created??? During each iteration, theItem is reassigned its value. The four closures reference this value. Since they reference this same value and since this value is reassigned ultimately to the value of the fourth index position, tHe time we execute closureArray later on, all four closures output the same string. This is because all four closures are within the same scope "the same environment" and therefore are referencing the same local variable, which has changed.
I have a couple of problems with this example:
1) I thought a closure is a function that is returned - the inner function is not returned above.
2) theItem is not even a local variable of the parent function (closureArray) - I thought in order for a closure to work, the inner function only accesses the local variables of the outer function, but in this case the local variable is defined OUTSIDE of the parent function.
3) the "the four closures are sharing the same environment." The thing is even in the second example, they are sharing the same environment.
Second example:
// A correct use of closures within loops
var myArray = [āAppleā, āCarā, āTreeā, āCastleā];
var closureArray = new Array();
[code]....
Here we iterate over the length of myArray (4 times), assigning the index of myArray to theItem variable. We also return a function reference to the closureArray during each iteration (closureArray[i]), where i is index number so we assign 4 functon references. So when we iterate through myArray, we immediatelly call the writeItem() fucntion passing an argument of theItem at its current value. This returns a child anonymous function and when that child function is called, it will execute a block that calls the predefined write() method. We assign that returned anonymous function to the variable closureArray. Hence, closureArray holds a reference to that anonymous function. So closureArray during each iteration holds a reference to the anonymous function and we later call closureArray, which in turn calls the anonymous function, therefore calling the predefined write() function to output the local variable of the parent function. This outputs each distinct index of myArray.
This is because since we created the closure, when we call writeItem, passing theItem argument, since theItem is a local variable of the parent function of the closure, it is never destroyed when we later call closureArray (the reference to the child anonymous function)? Yet weren't we using a closure in the first example as well? So whey wasn't those variables preserved?
I don't think it has anything to do with assigning a returned anonymous function to closureArray. Even though an anonymous function creates a new memory position in the javascript engine, therefore not overwriting the other function references we create during the iteration, it's still referring to a local variable declared outside the reference. So if it's about the closure retaining value of parent's local variable even after exiting the parent function allowing for the current indexes to be preserved, then why did the closure in the first example fail to retain each index?
View 7 Replies
View Related
Nov 14, 2011
how to add forms in javascript, but it's limited to text input forms.
<script type="text/javascript"><!--
function updatesum() {
document.form.sum.value = (document.form.sum1.value -0) + (document.form.sum2.value -0);
}
//--></script>
Where the inputs sum1 and sum2 are text fields you put whatever numbers you want in. That works fine. Great. Now what I'm having trouble with is modifying the code so that it will add one form with an input number with a form that spits out a randomly generated number.
<input type="button" value="D20" onclick="this.form.display.value = Math.round (20 * Math.random())" class="buttonHi" />Ā <input name="display" type="text" size="6" value="" />
This is what I'm using for my random number generator. So basically I want to be able to put, say, 5, into the input text field above this. And then click on the d20 button to get a random number, say, 15, and then have the first code add the inputted 5 with the randomly generated 15.
View 4 Replies
View Related
Mar 8, 2011
//-----10% Off Coupon-----
if (coupon=="N110"){
form.PRICE.value=-(moneyFormat(fTotal * .10)-1);
form.ID_NUM.value="N110";
form.NAME.value=" Craft Month Promo 10% Off";
location.href=location.href;
return true;
}
I want to replace the .10 with an external peice of data, so users can change the amount with having to open the script. Sorta like those early marquees' where the marquee text was inserted from a text file.
View 3 Replies
View Related
Sep 7, 2009
I hav linked external js (ext1.js) to my app.html page. Now in the ext1.js, I have a function like
[CODE] function onwindowload(){
//Access HTML element and append external js 2 (ext2.js) here
}[CODE]
//Access HTML element and append external js 2 (ext2.js) here--->I donno how to add external JS here.
Even if i add the external JS here, the JS uses document.write fn. which replaces entire page.
View 1 Replies
View Related
Apr 6, 2011
I've been writing a script using the Flickr API. Basically it takes photos from a certain set and user and puts those in the fancybox format. The problem I have now is that whenever I want the set to change, I have the edit the javascript,. Instead I want to be able to change this in the html where it's being called.
[Code]...
View 3 Replies
View Related
Oct 14, 2010
Been using jQuery for a while now and I'm sure I'm not using it to it's full potential. I have been enjoying GalleryView and recently updated to 2.0. I now wish to run an externally generated XML script which will be used to build a GalleryView implementation using the data in the XML as the foundation for the gallery. Currently the test page I have written works fine with a locally stored XML: Test Page (local XML)
However when I run the same page but with an external XML I get the following: External test Page
So if anyone can shed some light on how to do this I would be very grateful.
View 1 Replies
View Related