Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About taggs74

  • Rank
  1. taggs74

    onclick function call with parameters

    Thanks so much dsonesuk. Your Code looks alot cleaner than mine and also could well make it easier for me to add extra data, if needed, later on. spaces in file names noted. Cheers dude!
  2. taggs74

    onclick function call with parameters

    Dude, you are a hero.....works perfectly... as you can tell I'm not a programmer and certainly need to increase my knowledge....but "playing" certainly helps... thanks so much justsomeguy
  3. taggs74

    onclick function call with parameters

    I'm still struggling with the line $("#prod_menu_image_1").on("click", currentDiv(imageindex1)); to get the element on click to change...... any help is much appricated...
  4. taggs74

    onclick function call with parameters

    Thank you justsomeguy that makes a lot more sense of what is going on. I had a little look at .bind() and read, as iwato says, that it is now deprecated, so started looking at .on() but to no avail. I am just a newbie so please be patient with my lack of coding skills. dsonesuk here is my code (I think I have managed to anonymise it)
  5. taggs74

    onclick function call with parameters

    if I use document.getElementById("menu_image_1").onclick = currentDiv(1); the page works fine and passes parameter with my function running correctly. I can change "currentDiv(to any number in my index )" and all is good. the variable "this" is taken from another element that "helps" determine the parameter passed to the function. My problem is, I need to change calculate the argument before it is passed.
  6. Hi, I'm having a problem changing my image onclick attribute. I think it is a syntax issue around the var imageindex1 but I'm not sure. I think the error is with line 3 because if I take it out the page runs without error albeit not to the desired effect. Any help is much appreciated. document.getElementById("menu_image_1").src = $(this).find(":selected").attr("data-src1"); imageindex1=parseFloat($(this).find(":selected").attr("data-img-index")) +1 document.getElementById("menu_image_1").onclick = currentDiv(imageindex1); Many thanks