• We just launched and are currently in beta. Join us as we build and grow the community.

Image Bigger Viewer using HTML and JavaScript

B_R_I_A_N

Shonen Hero
Divine
B Rep
0
0
0
Rep
0
B Vouches
0
0
0
Vouches
0
Posts
90
Likes
142
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 200 XP
Have you ever encountered images that are so small or blur? These images need to be resized or zoomed in. There is a way to see this kind of images clearly. It is called "Bigger Image Viewer". You can use this tutorial for your Electronic Commerce System to bigger the image of your product.

Directions

Kindly add this code below to the HEAD section of your page.
  1. <link

    rel

    =

    "stylesheet"

    type

    =

    "text/css"

    href

    =

    "css/style.css"

    /

    >

  2. <script

    type

    =

    "text/javascript"

    src

    =

    "js/script.js"

    ></

    script

    >

  3. <script

    type

    =

    "text/javascript"

    src

    =

    "js/script_1.js"

    >
  4. </

    script

    >

Note: DOWNLOAD the source code for the external files. (click the "Download Code" below)
Just add the sample code to the BODY section of your page.
  1. <img

    src

    =

    "Images/11.jpg"

    style

    =

    "width:200px"

    data-plusimage=

    "Images/11.jpg"

    data-plussize=

    "600,366"

    /

    >

  2. <br

    /

    ><br

    /

    >

  3. <img

    src

    =

    "Images/22.jpg"

    style

    =

    "width:150px"

    data-plusimage=

    "Images/22.jpg"

    data-plussize=

    "500,350"

    /

    >

For the CSS source code.
  1. .caption{
  2. position

    :

    absolute

    ;
  3. font

    :

    normal

    13px

    Arial;
  4. }

  5. .caption

    a{
  6. position

    :

    block

    ;
  7. background

    :

    azure

    ;

    /*bg color of caption*/
  8. padding

    :

    3px

    ;
  9. border

    :

    1px

    solid

    blue

    ;
  10. text-decoration

    :

    none

    ;

  11. font-family

    :

    cursive

    ;
  12. font-size

    :

    13px

    ;
  13. }

  14. .caption

    a:

    hover

    {
  15. background

    :

    azure

    ;

    /*bg color of caption when mouse rolls over it*/
  16. font-family

    :

    cursive

    ;
  17. font-size

    :

    13px

    ;
  18. border

    :

    1px

    solid

    red

    ;
  19. color

    :

    red

    ;
  20. }

  21. .enlargebox{
  22. position

    :

    absolute

    ;
  23. display

    :

    none

    ;
  24. }

  25. .enlargebox

    .title{
  26. background

    :

    azure

    ;
  27. color

    :

    white

    ;
  28. padding

    :

    3px

    2px

    ;
  29. text-align

    :

    right

    ;
  30. font

    :

    bold

    14px

    Arial;
  31. }

  32. .enlargebox

    .title

    img{
  33. cursor

    :

    pointer

    ;
  34. cursor

    :

    hand

    ;
  35. }

Result

For the first image.
bigger_1.png

For the second image.
bigger1.png

Hope that this tutorial will help you a lot.

Share us your thoughts and comments below. Thank you so much for dropping by and reading this tutorial post. For more updates, don’t hesitate and feel free to visit this website more often and please share this with your friends or email me at [email protected]. Practice Coding. Thank you very much.


Download
You must upgrade your account or reply in the thread to view hidden text.
 

452,292

323,341

323,350

Top