I had similar problems, and I thought that I would drop this message to anyone who sees this stream.
In my opinion, you do not want BUTTONS, but a clickable image that acts like a button. Here is what I did:
HTML:
<img src="images/dagger.png" width="10%" height="10%" id="dagger" />
JavaScript / jQuery:
<script src="//code.jquery.com/jquery-1.10.2.js"></script> <script> $("#dagger").click(function(){ </script>
By doing this, you get rid of the usual โbuttonโ image, and you can use any image you want as a clickable button. In addition, you get the same functionality that you want from a button, and it opens up many other ways to achieve your goals.
Hope this helps!
The other method that I use simply puts the onclick
event in img
to call the function.
HTML:
<img src="images/dagger.png" width="10%" height="10%" id="dagger" onclick="myFunction()" />
JS:
<script> myFunction() { </script>
Depending on what you are doing and what you are trying to manipulate, all the examples on this page will provide you with the best / worst ways to do this. Using the onclick
event in the img
tag, you can pass the variables / information to the function you want to use, and then use the relay function for your PHP / ASP / etc. Also, if you were dealing with a form, you may have information about the function / subordination of your function, rather than the default view that the form uses. Use your imagination with the problems you are facing and decide which method works best. Never settle for learning just one way to do something.
Fata1Err0r
source share