i usually put the width 100% as most of the customers use mobile to browse the site
Code: Select all
<img id="myImg" src="xxxx" alt="cat 1" width="100%" >
thanks in advanced
Code: Select all
<img id="myImg" src="xxxx" alt="cat 1" width="100%" >
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
You can try following steps below to do thatallgoo wrote: ↑Wed May 17, 2017 12:47 amI use HTML in many sections in my website , mainly to display catalouge images ,
i usually put the width 100% as most of the customers use mobile to browse the site
i need a code to enlarge the image when clicked on to 200% or moreCode: Select all
<img id="myImg" src="xxxx" alt="cat 1" width="100%" >
thanks in advanced
Code: Select all
<script>
$(function () {
$('#myImg').on('click', function () {
$(this).width($(this).width() * 2);
});
})
</script>
http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension
Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme
Extra Positions PRO, Custom JavaScript, Custom CSS and others
thank you,, that worked perfectly , but it keeps getting bigger and bigger with every click , how can i control that so first click enlarge it , the second click reduce it again to original size ?viethemes wrote: ↑Wed May 17, 2017 10:08 amYou can try following steps below to do thatallgoo wrote: ↑Wed May 17, 2017 12:47 amI use HTML in many sections in my website , mainly to display catalouge images ,
i usually put the width 100% as most of the customers use mobile to browse the site
i need a code to enlarge the image when clicked on to 200% or moreCode: Select all
<img id="myImg" src="xxxx" alt="cat 1" width="100%" >
thanks in advanced
1. Install my free extension Custom JavaScript
2. Add below code into the extensionCode: Select all
<script> $(function () { $('#myImg').on('click', function () { $(this).width($(this).width() * 2); }); }) </script>
most of the customers are using mobiles , so the images appear are very small , so i want to add this option to them when they click on the image it enlarge a bit so they get to see the details and then close again , i will look for lightbox , if you have another idea , am all ears , thanks
Users browsing this forum: No registered users and 63 guests