Web Analytics Made Easy -
StatCounter Need a good light box image viewer thats easy to install - CodingForum

Announcement

Collapse
No announcement yet.

Need a good light box image viewer thats easy to install

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need a good light box image viewer thats easy to install

    Hi, i tried several image viewers for my website but some of them just done work anymore. I love fancybox but right now im so tight i cant afford to buy it or i would.

    I found this one but its a bit complicated to install...

    github.com/fengyuanchen/viewerjs


    here is what i have so far.

    Code:
    //must be in a div
    
     <div id="prodimages">
    
      <a href="example.com/images/image1.jpg"><img src="example.com/images/image1.jpg" alt="prodimage" /></a>
    
     </div>
    Then the js - i have already added the link tag and the script tag for the js in the file.

    Here is where it becomes interesting, when i do it this way the js bombs and tells me the module can only be loaded at the top level

    Code:
    <script type="text/javascript">
        
    import Viewer from 'viewerjs';   
    const gallery = new Viewer(document.getElementById('prodimages'));    
        
    </script>

    so then i add this above it and then it tells me that it cant load it because of a dissallowed MIME type of text/html

    Code:
    <script src="/js/viewerjs/viewer.js" type="module"></script>

    Any help or suggestion for a better viewer would be appreciated thanks I dont need anything fancy just a simple viewer will be fine
    Last edited by durangod; Jun 26th, 2019, 03:44 PM.
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  • #2
    nevermind sorry

    i did not know that lightbox2 from 8 years ago was still being developed.... its an old friend... ill go with that...
    Last edited by durangod; Jun 26th, 2019, 04:23 PM.
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

    Comment

    Working...
    X