Little Upgrades
![]() ![]() |
I think your $() function can be a little shorter, like this
function $(id,root){return (root||document).getElementById(id);}I'll post more as I look through, great script btw. |
![]() ![]() |
Nice... it never even occurred to me that you could use that type of syntax in Javascript. Its so much easier to read. Thanks a lot. |
![]() ![]() |
thanks joe.. his script Extra links is very useful, and I use couple of his youtube scrpits.. Thanks for helping here man ! |
![]() ![]() |
I miswell just ask instead of searching through code... do you resize the popup in any way? Sometimes they appear over the mouse pointer, and I've been trying to correct that in my script. |
![]() ![]() |
The main way I tried to handle that mouseover/mouseout problem was having the popup appear on the right half of the screen when the cursor was on the left (and vice versa). That solved the problem completely for me, but people with low resolutions will probably still be affected. Also I have separate settings for enabling popups for profile pics and regular photos for if people don't want the bigger popups. I also do some resizing with this css:
'#FBPPdiv img { max-height: ' + (window.innerHeight-35) + 'px; }'
But that's primarily to make sure that big popup pictures fit on the screen (since you can't scroll them). I think I need to increase that value from 35 though. |
![]() ![]() |
Vaughan Chan... wrote:Yeah that's what I did too. It goes in the opposite corner of where the mouse is, i.e., if you hover over a thumbnail in the top-left, it will show the full size popup in the bottom right. Sometimes the thumbnails are too close in the middle and it ends up popping up over the mouse and flashing, so I tried to fix that in my script linked above, and it works decently. I think you should have a look at it. All I do is make the max-height the browser innerHeight minus 8, and made the max-width so it fit in between the side of the window and the pointer using e.clientX-20. You can see it where I do img.style.maxWidth = (x-20)+"px";
That makes it fit on the left side without overlaying the pointer, but now I had to make support for the popup coming up on the right side, so I did this: if(left) x=window.innerWidth-(x+10); which made it fit, once again, between the wall and the pointer but this time on the right side. I set some booleans so I'd know which side the pic was on using left = getPosition(e)[1]<(window.innerWidth/2); then later I could just put the pic on the opposite side and opposite corner.
Anyways, it's the best I could come up with, and I don't want to ramble when you can just see my code.
-Cheers. |


