我想要水平和垂直翻轉圖像我該怎麼做? onClick函數通過它的id。翻轉與圖像的Div或只是圖像onClick =翻轉('ID NAME');
<script>
function fliph(imageid){
var imageid = imageid;
//What Should I have to Type HERE???
}
function flipv(imageid){
var imageid = imageid;
//What Should I have to Type HERE???
}
</script>
<input type="submit" name="flip" value="Flip Horizontal" onClick="fliph('imageid')" />
<input type="submit" name="flip" value="Flip Vertical" onClick="flipv('imageid')" />
<img src="http://classihome.com/uploads/gallery/1453292889developlda.jpg" id="imageid">
檢查這兩個環節[1](http://stackoverflow.com/questions/14694205/flipping-an-image-with-js-jquery)和[2](http://stackoverflow.com/questions/507138/how-do-i-add-a-class-to-a-given-element)以及合併... – SamGhatak
如果可能的話使用jQuery ... – SamGhatak
@SamGhatak你展示的鏈接是完美的。但是當我做他們複製他們不工作任何腳本文件必須附加可以請你給我我試過這些鏈接。 –