• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

jquery problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys,

im a complete greenhorn when it comes to javascript or jquery etc, (started building this last wednesday or so)

anyway, i have a problem with a site im doing, it seems to work in firefox, but not in any other browser. i have searched around, but really struggling as to what to search for!

here is the url: Click

if you click left turn, then change run1 value, it wont move the corner image, (it works fine in firefox)

i know there are a few other problems with it, (dosent work in ie at all at the moment!)

im slowly cutting the bugs out but this one is really foxing me


any help would be appreciated.


Thanks,

Tom.
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What have you done to debug this in other browsers? What leads you to conclude that it's a jQuery issue? Have you narrowed it down to the code snippet that's failing?
 
tom hancock
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well Ive been making this for a few days, and testing in firefox, so I was using firebug, and once it started working in ff, I tried the other browsers.

also, i think its not working perfectly in firefox either now, after testing it for a while.

im sure its not a jquery problem, and more than likely is a problem with my code (its messy!)

I have tried to narrow it down, but I have another piece of code that is almost the same, that works fine.

I think its the following line(s) that are the problem:
var turntype = $("select#turntype").val();
var turn = $("select#turn").val();
var rn1 = $("select#run1").val();
var numr = $("select#rises").val();
var run2 = numr - rn1;
if (turntype == 1) {tot = "quaterspace";}
if (turn == 1) {handing = "lh", horisontalshift = (run2 * 56)+4, verticalshift =8;} //* if i change the run2 variable to any other var, it works.
if (turn != 0) {create_turn = '<span class=' + handing + tot + '></span>';}
$("div#turnwrapper").css({position: 'absolute', left: + horisontalshift + 'px', top: + verticalshift +'px'});
$("div#turnwrapper").html(create_turn);



thanks,

Tom.
 
tom hancock
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ah got it!
changed
$("select").change(function(){
to
$().change(function(){

works fine

need to rtfm i think
 
Bear Bibeault
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh I do love it when things get settled before lunch! Congrats!
 
reply
    Bookmark Topic Watch Topic
  • New Topic