English 中文(简体)
jQuery lightBox plugin by balupton
原标题:

Using the jQuery plugin http://jquery.com/plugins/project/jquerylightbox_bal

Is there a way to have the title and NEXt/PREVIOUS buttons always appear. Currently we have to hover to have these appear and my users mostly aren t noticing that.

LightBox2 and others allow this but I need it based on jQuery as the other frameworks interfere with my other js.

It s for this web site: http://BiblePro.BibleOcean.com

最佳回答

It is not currently possible as an option, however you can modify the lightbox js file with the following changes:

        // Prev
        $( #lightbox-nav-btnPrev ).unbind().hover(function() { // over
            $(this).css({  background  :  url(  + $.Lightbox.files.images.prev +  ) left 45% no-repeat  });
        },function() { // out
            $(this).css({  background  :  transparent url(  + $.Lightbox.files.images.blank +  ) no-repeat  });
        }).click(function() {
            $.Lightbox.showImage($.Lightbox.images.prev());
            return false;
        });

to:

        // Prev
        $( #lightbox-nav-btnPrev ).css({  background  :  url(  + $.Lightbox.files.images.prev +  ) left 45% no-repeat  });

and the same for the next a few lines below.

Later on you will find:

                // If not first, show previous button
                if ( !this.images.first(image) ) {
                    // Not first, show button
                    $( #lightbox-nav-btnPrev ).show();
                }

                // If not last, show next button
                if ( !this.images.last(image) ) {
                    // Not first, show button
                    $( #lightbox-nav-btnNext ).show();
                }

Change that to:

                // If not first, show previous button
                if ( !this.images.first(image) && !this.images.last(image) ) {
                    // Not first, show button
                    $( #lightbox-nav-btnPrev,#lightbox-nav-btnNext ).show();
                }

And that should do it for you. You can either include the unminified js file in your html, or minify that js file and save that (I use the YUI js compressor).

I will consider making it an option for a future release.

问题回答

Consider this approach If you don t get any answers which give a approach to solve your problem using the inbuilt jQuery things.

I have been successful in editing styles of jQuery Plugins to achieve what I want, if it doesn t already provide it. (unless its implemented through jQuery functionality rather than just by using styling).

Use Firebug or IE Toolbar to see what style is rendered to those elements on hover, then change that styling to reflect what you want in the base style itself instead of onhover.

Thanks





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签