0

I am using the below piece of code in SharePoint to show the preview in a small popup box when mouse hover a link. However, this works fine for aspx pages whereas for the documents such as pdf/pptx/docx/xslx it prompts the command box to open or save the document when mouse over on particular link.

<head>
  <meta charset="utf-8">
  <title>MiniPreview Demo</title>

  <link href="https://fonts.googleapis.com/css?family=Roboto+Slab" rel="stylesheet">
 <script src="https://eu001-sp.shell.com/sites/AAFAA2122/siteconfig/SiteAssets/Mouse%20over%20functionality/2.0.3-jquery.min.js"></script>
  <link href="https://eu001-sp.shell.com/sites/AAFAA2122/siteconfig/SiteAssets/Mouse%20over%20functionality/image_preview_for_links.css" rel="stylesheet"> 

  <!-- MiniPreview stuff here -->
  <link href="./jquery.minipreview.css" rel="stylesheet">
  <script src="./jquery.minipreview.js"></script>
  <script type="text/javascript">
    $(function() {
                $('#p1 a').miniPreview({ prefetch: 'pageload' });
                $('#p2 a').miniPreview({ prefetch: 'parenthover' });
                $('#p3 a').miniPreview({ prefetch: 'none' });
            });
  </script> <script src="https://eu001-sp.shell.com/sites/AAFAA2122/siteconfig/SiteAssets/Mouse%20over%20functionality/image-preview-for-links.js"></script>
</head>

<body>
  <p id="p1">
  Check out this link to
    <a href="https://eu001-sp.shell.com/sites/AAFAA2122/siteconfig/default.aspx">Site Configuration site</a>. Hover over it to see a small preview of what it points to.
</p>

<p id="p3">
  Check out this link to
    <a href="https://eu001-sp.shell.com/sites/AAFAA2122/siteconfig/Documents/WSR.pptx">WSR Report</a>. Hover over it to see a small preview of what it points to.
</p>

</body>

===============================================================================

Any ideas to crack this? I would be really thankful for any sort of suggestions.

-1

Which version of SharePoint you are using, if its SharePoint 2013 or 2016 then make sure office web app server (for 2013) or office online server (for 2016) is installed and you are able to check preview in document library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.