1

I trying to use retina.js v2.0 to swap images, but it's not working, I don't know why. I also check it in developer tools, but there's not any error. Can u help me, what could be the problem?

HTML:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Test</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="robots" content="noindex, nofollow" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>    
</head>
<body>
    <img src="images/logo.png" data-rjs="2" alt="Logo">
    <script type="text/javascript" src="retina.min.js"></script>
</body>
</html>
pzoli
  • 87
  • 1
  • 8

1 Answers1

0

Have you figured this out? I am having the same issue. I found a resolution, by calling retinajs() directly after the script loads. But, reading the How It Works documentation does not say you need to do this.

Here is what I did:

<html lang="en">
<head>
</head>

<body>
    <img src="/images/nav_logo.png" data-rjs="2">
    <script type="text/javascript" src="/lib/retina/retina.min.js"></script>
    <script>
        retinajs();
    </script>
</body>

Yes, this works but my question is whether it is "right"?

Shane Kenny
  • 28
  • 1
  • 4