![]() |
|
|||||||
| Computer hardware, software, networking and internet Discuss Any javascript experts out there...I have installed a floating slideshow into my website but am having a couple of coding problems...... The reason I ... |
|
Welcome to the Pixalo Photography Community. As a Guest you are free to browse the site, but see what extras you get as a Member here.
|
|
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Been here a while
Join Date: Sep 2006
Location: Chesterfield, UK
Posts: 465
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Any javascript experts out there
I have installed a floating slideshow into my website but am having a couple of coding problems......
The reason I want to alter the show is the original has a maximum image height of 395px - small for portrait orientation - this solution allows for larger pictures WITHOUT altering the look of the site. 1. when I used Jalbum with Bananalbum I could set the x/y co-ordinates to sh/2 (screen height) so the show was always centred regardless of the viewers screen size. 2. also the fade transitions I have got seem a little harsh and am wondering if I've got this code wrong The sample page is gallery select wedding gallery I and the script code is as follows: ANY help will be very appreciated and have to be at a very basic level PHP Code:
Simon Last edited by Steve; 04-06-2008 at 20:47. Reason: extra info |
|
|
|
|
|
|
|
#2 (permalink) |
|
Pixalo Crew
Join Date: Jan 2005
Location: An Englishman living in Germany
Posts: 16,627
![]() ![]() ![]() |
Re: Any javascript experts out there
I am very poor at JS but looking through that code and at your gallery it seems that the image height issue has been resolved but the positioning for the horizontal images is currently too height (only viewing in FF so can't comment about other browsers). The only control I see in that codes is the X, Y co-ordinates but they appear to be from the center of the images not the lower left corner...if they had been from the latter it would have been a snip to alter.
The second issue of the fade...besides the setting near the top of the code, there is another one lower down... PHP Code:
__________________
.......__o .......\<, ....( )/ ( ) |
|
|
|
|
|
#3 (permalink) | |
|
Been here a while
Join Date: Sep 2006
Location: Chesterfield, UK
Posts: 465
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Any javascript experts out there
Quote:
The transition thing is liveable with to get the larger images and altering the second value seems to have no effect whatsoever
|
|
|
|
|
|
|
#4 (permalink) |
|
Pixalo Crew
Join Date: Jul 2006
Location: Peak District
Posts: 10,515
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Any javascript experts out there
Was going to say similar to Steve (even to my rubbish java!) tho' I'd comment out the top line of the two which is redundant and just might be interfering (tho transitions look OK here - IE7)
document.images.SlideShow.style.filter="blendTrans (duration=2)"; document.images.SlideShow.style.filter="blendTrans (duration=crossFadeDuration)"; Positioning is controlled via the co-ordinates starting in any corner but there is no "centre" as such - but it is justified left/right and top/bottom, whatever the screen size |
|
|
|
|
|
#5 (permalink) | |
|
Been here a while
Join Date: Sep 2006
Location: Chesterfield, UK
Posts: 465
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Any javascript experts out there
Quote:
Is there no way of determining the centre point of either axis..... I had been given the following info but have no idea where to put it ![]() grab the browser's height from whatever browser they user is using. document.documentElement. clientHeight/Width would grab that info for you, so you can do something like: var browHeight = document.documentElement. clientHeight var browWidth = document.documentElement. clientWidth then where you need to make the X/Y coordinates if you want the height so you have it centred vertically (it's semi tricky as you have either portrait or landscape so you need to choose which way you want it to look centred I'm going to do portrait as the sample) so here's the info you know you can get: your image is going to be 600px high you can get the client's browser size let's pretend it's 1000px high just for easy numbers so what you want to do is make a new little equation var myHeight = (browHeight - 600)/2 so you're taking the browsers height minus your picture's height then dividing by 2 so you have the same space top and bottom, so with my sample numbers it'd drop the pic down 200 |
|
|
|
|
|
|
#6 (permalink) |
|
Pixalo Crew
Join Date: Jan 2005
Location: An Englishman living in Germany
Posts: 16,627
![]() ![]() ![]() |
Re: Any javascript experts out there
The theory you have there is sound but in practice its more complicated. You need more variables as you will need to grab both the browser windows size, the offset co-ordinates to the spot where you want to display the image and then manipulate those variables with the ever changing image size variables...
the JS code that appears to be doing all that is this section... PHP Code:
Sorry
|
|
|
|
|
|
#7 (permalink) |
|
Pixalo Crew
Join Date: Jan 2005
Location: An Englishman living in Germany
Posts: 16,627
![]() ![]() ![]() |
Re: Any javascript experts out there
Could you not do a simple work round?
Instead of battling with JS, why not make the gallery display in a floating 'div' absolutely positioned in the bottom left corner? With a little playing around with X,Y co-ordinates for the div you should get your required results. A lot will depend on how the rest of your site was coded though... |
|
|
|