Days
Hours
Minutes
Seconds

Super Black Friday Sale!

0
No products in the cart.

Forum Replies Created

Viewing 6 posts - 736 through 741 (of 741 total)
  • Author
    Posts
  • in reply to: How can I use fancybox using onclick? #10137
    blankabctest483
    Member

    Don’t do it that way. If you can’t generate unique IDs (or simply don’t want to) you should be doing it with CSS classes instead:

    <a href="image.jpg" class="fancy"><img src="image_thumbnail.jpg"></a>
    

    with:

    $(function() {
      $("a.fancy").fancybox({
        'zoomSpeedIn': 300,
        'zoomSpeedOut': 300,
        'overlayShow': false
      }); 
    });
    

    (from their usage page).

    in reply to: Recommended way to embed PDF in HTML? #9331
    blankabctest483
    Member

    Probably the best approach is to use the PDF.JS library. It’s a pure HTML5/JavaScript renderer for PDF documents without any third-party plugins.

    Online demo:
    https://mozilla.github.io/pdf.js/web/viewer.html

    GitHub:
    https://github.com/mozilla/pdf.js

    in reply to: Recommended way to embed PDF in HTML? #9313
    blankabctest483
    Member

    To stream the file to the browser, see Stack Overflow question How to stream a PDF file as binary to the browser using .NET 2.0 – note that, with minor variations, this should work whether you’re serving up a file from the file system or dynamically generated.

    With that said, the referenced MSDN article takes a rather simplistic view of the world, so you may want to read Successfully Stream a PDF to browser through HTTPS as well for some of the headers you may need to supply.

    Using that approach, an iframe is probably the best way to go. Have one webform that streams the file, and then put the iframe on another page with its src attribute set to the first form.

    in reply to: Recommended way to embed PDF in HTML? #9322
    blankabctest483
    Member

    FDView combines PDF2SWF (which itself is based on xpdf) with an SWF viewer so you can convert and embed PDF documents on the fly on your server.

    xpdf is not a perfect PDF converter. If you need better results then Ghostview has some ability to convert PDF documents into other formats which you may be able to more easily build a Flash viewer for.

    But for simple PDF documents, FDView should work reasonably well.

    in reply to: How can I change an element's class with JavaScript? #9680
    blankabctest483
    Member

    No offense, but it’s unclever to change class on-the-fly as it forces the CSS interpreter to recalculate the visual presentation of the entire web page.

    The reason is that it is nearly impossible for the CSS interpreter to know if any inheritance or cascading could be changed, so the short answer is:

    Never ever change className on-the-fly !-)

    But usually you’ll only need to change a property or two, and that is easily implemented:

    function highlight(elm){
        elm.style.backgroundColor ="#345";
        elm.style.color = "#fff";
    }
    
    in reply to: How can I change an element's class with JavaScript? #9681
    blankabctest483
    Member

    This is easiest with a library like jQuery:

    <input type="button" onClick="javascript:test_byid();" value="id='second'" />
    
    <script>
    function test_byid()
    {
        $("#second").toggleClass("highlight");
    }
    </script>
    
Viewing 6 posts - 736 through 741 (of 741 total)