How To Make This Array Work For 2 Columns

Mar 17, 2010

See example at: [URL]. I want the thumbnails in 2 columns, not 1. Here is the javascript:
Code:
function ImgColumn() {
var str = '';
for (var i=0; i<imgArray.length; i++) {
str += '<div onMouseOver="Enlarge('+i+')">';
my_pic = 'mypic'+i;
// my_src = imgArray[i][0];// not used here
str += '<IMG id="'+my_pic+'" SRC="'+imgArray[i][0]+'" value="'+i+'"';
str += ' alt="'+imgArray[i][1]+'" BORDER="0" HEIGHT="70" WIDTH="70"><IMG SRC="images/spacer.gif" BORDER="0" HEIGHT="1" WIDTH="10"><br>';
str += '</div>';
} return str; }

And the HTML:
Code:
<table width="200" height="400" border="0" cellpadding="0" cellspacing="0">
<tr> <td><script type="text/javascript">
document.write(ImgColumn());
</script>
</td>
</tr>
</table>

View 14 Replies


ADVERTISEMENT

Make Array Show 2 Columns?

Mar 17, 2010

See example at: [URL]I want the thumbnails in 2 columns, not 1. Here is the javascript:

[code]....

View 1 Replies View Related

Accessing Certain Columns Of An Array

May 3, 2011

If I have this array
Code:
testarray = [
["1", "test1", "test11"],
["3", "test3", "test33"],
["5", "test5", "test55"],
["2", "test2", "test22"]
];
How do I access the 2nd column of the 2nd row?

I tried:
Code:
alert(testarray[1][1]);
But it says undefined.

View 4 Replies View Related

JQuery :: Make A 'Circulate' With 2 Columns?

Nov 14, 2011

I was making a menu with 2 columns, I need this menu for my work, I tried to do it with jquery, it worked, but is a little bug in this menu: When I click over to the left, the table disappears, and when I clickgets right to the table with a large space.

Objective: Make a menu with 2 columns, which when you press the left button, the menu go to the left showing more objects, and the same right, and Circulate.There is my code:

[Code]...

View 2 Replies View Related

JQuery :: More Columns Than Header Columns Produce Variable Not Found Error

Sep 20, 2011

When a thead contain less columns than real columns in the tbody section, the Tablesorter plugin produces a variable not found error in jquery coreTo reproduce simply do not put all <th> in thead that correspond to columns in tbody.

View 1 Replies View Related

Turn A Row Of 6 Into 3/3 Side By Side In Code - Make Page Into 2 Columns

Mar 30, 2009

The code on how to make this page into 2 columns. Right now I have everything in 1 long row of 6...id like to see how to make it 3 and 3 side by side...

View 2 Replies View Related

Onchange Won't Work - How To Make It Work

Mar 15, 2011

this will not work on change. also the innerhtml wont display. please help. here is the js:

function checkemail(){
if (document.suform.email.value && document.suform.emailcheck.value)
{
if (document.suform.email.value == document.suform.emailcheck.value)

[code]...

and here is the html:

Re-type Email: <input type='text' class='rfield' name='emailcheck' id='emailcheck' onchange='checkemail()'></td><td style='position: relative;'><div id='wm' style=' font-size: 11PX; position: relative;'></div>

View 4 Replies View Related

How Can I Make It Work??

Jan 24, 2006

<script language="JavaScript">
<!-- Begin
var msg="I am flashing!";
var speed=300;
var visible=0;
function Flash() {
if (visible = 0) {
window.status=msg;
visible=1;
} else {
window.status=" ";
visible=0;:confused:
}
setTimeout('Flash()', speed);
}
// End -->
</script>

View 1 Replies View Related

How To Make Sending That Var Work

Jun 5, 2009

function ajaxFunction4(){
document.getElementById('ajaxDiv4').innerHTML='uploading...'
var ajaxRequest; // The variable that makes Ajax possible!

[code]....

View 2 Replies View Related

Make A Dynamic Box Work With Sql

Mar 3, 2011

I cant get to know how can i make a dynamic box work with sql!i found this code online which takes in the values from database and puts it in combo box one,once a field in combo box one is selected the related field will be displayed in combo box two.its like country and state combo box but from sql database. it does not load from database the field for combo box one.

View 2 Replies View Related

JQuery :: Make A Multidimensional Array?

Nov 19, 2010

To get to the chase,ihave a sort of lightbox-app and i need to make a multidimensional rray.

This is what i got sofar:
var imageNum = 0;
var linkArray= new Array;

[code]....

View 5 Replies View Related

Make An Array Inside A Loop?

Feb 10, 2011

I have this loop:

for (var j = 0; j < gmarkers.length; j++) {
gmarkers[j].hide();
elabels[j].hide();
map.closeInfoWindow();

[Code]....

which was useful for passing the p variable when it was just one number.

but now I need to get that number every time j gets set (I understand that the j gets overwritten each time the loop goes through).

What would be ideal is if p could become an array, the contents of which match the values that j has passed though during the loop cycle.

I thought var p = new Array (j); minght do the trick, but obviously not...

View 4 Replies View Related

Make A 2-d School Schedule From An Array?

Jan 2, 2011

How would a make a 2-D school schedule? The first row should have in it the days of the week and the first column should have the number of periods. The array should be 6 x 12. And how would I be able to ask the user what day/period they would like to know the schedule for? For example if they wanted to know what class was mondays 3rd period it would say math.

View 2 Replies View Related

Array :: How Would I Make The Buttons For The Numbers?

Jul 30, 2011

I am starting to learn javascript and have been trying to make a image gallery. I was hoping to take an array of src and create a link for each one which when clicked on changes the src of an already existing img.My question though is how would I make the buttons for the numbers.I feel like a loop would work for this but I just can't seem to figure it out. I don't know how far off I am in thinking that through a loop I could create functions with a name plus the i variable.And in each function there could be something like:

Code:
document.images["destination"].src = images[i]
That would then produce an <a> with the href equal to the function name + "i" with the title being "i" as well.

Am I way off? How would I execute that? A little explanation about my code. I am going to be using a loop to add the images that will vary in amount for each page that is why I have the push function just for this test. And the document.ready is because I've been using some jQuery.

Code:
<script type="text/javascript">
$(document).ready(function(){[code]...............

View 2 Replies View Related

JQuery :: Can't Make AddClass Work?

Mar 9, 2011

I have html code:

<div id="dropdown" class="rMenu">
<ul id="middlemenu" class="rMenu-hor rMenu">
<li><a href="page.html">Page</a></li>

[code]....

View 1 Replies View Related

Onmouseout Not Working - How To Make It Work

Jun 9, 2009

I have a webpage with addition questions for numeracy training. I am storing the sums in a table(id="sums"), with an empty textbox(id=ans1) for the user to type the answer. After the user types an answer and moves onto the next Q, I want to activate a popup dispaying if the answer is correct or not. I am tackling this with onmouseout. The script checks the answer, then displays a confirm message if correct or and alert message if wrong. The onmouseout is not working

Code:

input type="text" name="ans1" size="1" maxlength="2" id="ans1" onmouseout="checkAns1();"

Code:

function checkAns1(){
if(document.sums.ans1.value==(document.sums.Q1R1.value + document.sums.Q1R2.value)){
var confirm("correct");

[code]....

View 14 Replies View Related

Stickies App Not Working - How To Make It Work

Mar 19, 2009

I must have a syntax error, because this function crashes the entire script (even the other functions).

function newNote()
{
allNotes = document.getElementById('notes-stickies-app').innerHTML;
secondadder = 1;

[code]...

EDIT: to get to the stickies part, click the apple menu, and click stickies. you'll see how the stickies wont drag because this script that adds new stickies has a problem.

View 2 Replies View Related

Make Unobtrusive Work All The Time?

Jul 11, 2009

I'm working on implementing an unobtrusive javascript where I use code instead of an HTML hook to call a function.

Old way: <input type="text" name="username" onBlur="javascript:function();" />

Now I have changed it to:

window.onload = function()
{
if(document.getElementById("username"))
{
var usernameInput = document.getElementById("username");
usernameInput.onblur = checkUsername('username','ajaxResponse');
}
}

which is placed in the body section of the page. Anyhow, my problem is that it works fine, but only once, right as the page loads. I have tried removing window.onload, but then it doesn't work at all. How can I get this to work every time I blur from the text field?

View 1 Replies View Related

For Loop Not Working - How To Make It Work

Jul 17, 2009

Why wont my for loop work it wont alert the var images1....

<script type="text/javascript">
for(i=1;i<6;i++){
images[i] = "no"+i+".jpg";

[code]...

View 2 Replies View Related

Make CSS Opacity Setting Work In IE7?

Nov 30, 2006

I have implemented a feature that works in firefox and opera, but doesn't work in IE -- it is the css opacity setting.I am overlaying translucent divs over a jpg image. Do I need to use javascript to fix this for IE ?

View 7 Replies View Related

AJAX :: Cant Make SetTimeout() Work In My PHP

Nov 4, 2011

I cant make this work here is what I have in my logged_in.php file .

<html

View 5 Replies View Related

GetElementById Not Working - How To Make It Work

Dec 27, 2010

This seems like a total beginner thing, but I don't know why it isn't working. I'm working from examples from a sitepoint pdf. Here's my html:

Code:

<body>
<h1 id="stupid">sdfasd</h1>
<p>sdjfa</p>

[code]....

When I run an if statement, I'll get an alert letting me know that the value of target is null, but why is it null? It should contain a reference to the h1 node.

View 4 Replies View Related

Make A Save Button Work?

Mar 11, 2003

How do I make a save button work?

View 11 Replies View Related

Make This Code Work For Both IE And Mozilla?

Jan 11, 2010

how to make the following code work for both IE and Mozilla?

function AddRow()
{
if (navigator.appName=="Microsoft Internet Explorer")

[code]...

//the following javascript function is saved in another .js file which is then called from the main php file when the above button is clicked. It works fine with Mozilla and Chrome.

function AddRow()
{
var morerow=document.getElementById("tbl")

[code]...

Also, why are you mixing DOM standard with innerHTML?

View 1 Replies View Related

JQuery :: How To Make Text Match Array

Jul 22, 2009

I have string and array:
text = "xxxxxxonexxxx"
array = ["one", "two"]
I need
if (text.match(array)) {...}
But it does not working. How can I check this?

View 1 Replies View Related

JQuery :: Use String As An Array To Make $.each For Iteration?

Jan 11, 2011

I get a XmlHttpRequest responseText from a AJAX JSON call. This is a string. I created an example:

var testString = "{'desc':'text1','name':'text2'}";
$.each(testString, function(key, value) {
alert(key+': '+value);
});

[Code].....

Instead I get every char of the string each in one alert message. How can I transform the String to an Array, or get in this case the two key-value pairs?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved