Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7159603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:15:30+00:00 2026-05-28T13:15:30+00:00

I have the following Fancybox declarations in my page: <script type=text/javascript> $(document).ready(function() { $(.fancybox).fancybox().hover(function()

  • 0

I have the following Fancybox declarations in my page:

<script type="text/javascript">
    $(document).ready(function() {
        $(".fancybox").fancybox().hover(function() {
            $(this).click();
        });
        $("#fancybox-outer").fancybox().mouseleave( function() {
               $("#fancybox-overlay").click();
         });
    });
</script>

I need to reduce the size of the image used by the modal box and I believe I can do that by setting the “autoDimensions”, “width”, and “height” options available with Fancybox, I just don’t know how to integrate that with the hover function, since there isn’t an option in Fancybox to specify a function for a hover event. (I hope this is making sense.)

Anyhow, does anyone know how I can modify the above javascript to control the width and height?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:15:30+00:00Added an answer on May 28, 2026 at 1:15 pm

    Sorry but images in fancybox don’t use “autoDimensions“, “width“, and “height” API options. Those options are for ajax, iframe or inline content only.

    Images in fancybox are displayed either, re-sized to fit into the viewport (when autoScale is set to true) or in their original size (when autoScale is set to false). If the original size is bigger than the height of the viewport, then you have to scroll down the parent page to see the whole image.

    The only way you can re-size images in fancybox other than above is using jQuery css() API (which, I wouldn’t advise … it produces an odd behavior). You can call it using fancybox’s callback option onComplete like:

    <script type="text/javascript">
     $(document).ready(function() {
      $(".fancybox").fancybox({
       'onComplete': function(){
        $("#fancybox-outer, #fancybox-content").css({'width':300,'height':150});
       }
      }).hover(function() {
       $(this).click();
      });
      $("#fancybox-outer").fancybox().mouseleave( function() {
       $("#fancybox-overlay").click();
      });
     });
    </script>
    

    Note that options mentioned above are for fancybox v1.3.x.

    Use it at your own risk.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My problem is a little bit complex. I have the following code: $(document).ready(function() {
I have the following code which I use to match fancybox possible elements: $('a.grouped_elements').each(function(){
I have a form on the following page: http://mmicet.yazminmedia.com/qseries (Click the Keep me updated
I have following script and it works fine with FF and Safari. function swapimage(cid)
I have following text in a file 23456789 When I tried to replace the
I'm using Fancybox and Zend. Hope the following is clear. On www.example.com/template/edit/id/3 I have
I have following script: #!/usr/bin/python while True: x = raw_input() print x[::-1] I am
I have following HTML menu: <ul> <li><a href=index.html>Index Page</a></li> <li><a href=#some-page>Some Page</a></li> </ul> Let
I have following structure of an HTML document: <body> <div class=main> <div class=left></div> <div
I have following simple code: <%@ Page Language=C# AutoEventWireup=true CodeBehind=testForm.aspx.cs Inherits=Orbs.testForm %> <html> <body>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.