views:

93

answers:

1

Oh, the frustration!

I have literally had the most frustrating morning ever. I've spent 4 and a half hours trying to get this to work.

The jQuery plugin in question is jScrollPane: http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html

My webpage is http://furnace.howcode.com - please just ignore the test data there during development ;)

So if you examine the source, you'll see this:

jQuery(document).ready(function() {
    $('#newesttab').addClass('selectedtab'); 
    $('#col2').addClass('newestcol');
    $("#ajaxresults").fadeOut("slow", function() {
        $.ajax({
            url: "<?php echo site_url('code/newest'); ?>",
            success: function(msg) {
                $('#ajaxresults').html(msg);
                $("#ajaxresults").fadeIn("fast");
                $('#col2').jScrollPane();
            }
        })
    });

The line $('#col2').jScrollPane(); is the line that's meant to make the jScrollPane trigger. It does... but, as you can see from the site, half of the div is cut off. I worked it out to be because #col2 has margin-left: 160px so it cuts off halfway. But, when I try to use a workaround, it breaks the rest of my page structure.

The second problem is that if I try and apply jScrollPane on any other div, I simply get no effect. I tried putting #col2 in a wrapper, #col2wrapper and applying it to that, but nothing at all worked. It's properly confusing.

If anyone can work this out, I will be so insanely pleased that I will give them a virtual high-five and other appreciative things.

Thanks!

Jack

A: 

Hi,

I think this is more css issues related with jScrollPane.css,

The problem is the width of jScrollPaneContainer. Look in Firebug what it does (if you don't use it, reconsider this, you saw in 5minutes, I was able to identify the problem without knowing your code before ^^). Try to delete position:relative of jScrollPaneContainer and position:relative in #col2, and it should work easier.

Edit : Simpler : just delete overflow:hidden; from class jScrollPaneContainer and it will do the trick.

Michael Lumbroso
Whilst I appreciate your help, this didn't help one bit. Of course, I've tried using Firebug... but jScrollPane's CSS is all generated dynamically so changing it isn't so easy. Deleting position:relative from the two divs doesn't make jScrollPane work any more than it did before, it just makes the divs visible, but the plugin still isn't functioning as it should!
Jack Webb-Heller
Hi, only a small part of the CSS is generated dynamicallyWell what about deleting overflow:hidden from jScrollPaneContainer in the css? When you suppress it with Firebug, it seems quite ok to me. First lines in the CSS delete that and tell me if it's ok.PS : Please read answers till the end, it helps ;) No agressivity required or negative vote needed, I'm just trying to help by pointing relevant matter I think :)
Michael Lumbroso
OK, sorry, I didn't mean to come across like that! I have commented out the first line (on my local copy) and now what happens is, we can see the whole of #col2, but when you scroll down, #col2 is no longer fixed and 'flies' up the page. Also, we're still not seeing any of jScrollPane's scrollbars. What to do next...? Thank you, I do appreciate the help :)
Jack Webb-Heller
If you deleted overflow:hidden, then you can put back position :relative on #col2, this will prevent the fly. No problem for your previous comment, I know what it is to spend the whole day on small problems (like with f*kin IE bugs ^^). For the scrollbar issue, try to integrate simple examples from the jScrollPane site and see if there is still same issue. I don't know the use of it, so can't help you more ;)
Michael Lumbroso