If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

[RESOLVED] Image scale onclick

I never get any better - Iím sorry. Iíve hunted around and canít find this covered on here. It used to be bad practice to resize an image with code but SVG files render beautifully at any scale and Iíd like to try this out.

Iíd like to have a series of images, each one doubling in scale when clicked then returning to its original size when clicked a second time.

Could I use transform: scale(2) somewhere in there to make it extra streamlined?

try just using toggle() instead of toggle(this) and then at the toggle function add an alert to see if it triggers. You can use Chrome's web developer tools to debug your code to see whether or not the code is triggered. Just navigate to your script under the script tab, put a break point on the first line of your function and click your image. If it works, it'll break and you can step through the code.

Ah, thanks for your patience - I'm sorry, I'm way below this level of knowledge - I've no experience of debugging with Chrome, having a look for the first time now but it's 4 in the morning here and I'm a bit fuzzy. I'll look on tomorrow, unless there's an obvious problem or an alternative solution you could highlight for me? Thanks again... I'm sorry for being so needy...

Well I'll need an exact error from the debugger to help here, try to remove this as a parameter to toggle cause you maybe overwriting the object. When a function is triggered by event like on click, you have access to the this variable anywhere in the called function.the other thing you could try is adding return true to the end of the function.

doesn't seem to change anything... I'm in so far over my head. Chrome just has undefined (repeated 0 times) under that function toggle (this) line - Dreamweaver (sorry) suggests it contains a syntax error.