webmaster1 Posted November 26, 2008 Share Posted November 26, 2008 Can something similar be constructed with PHP alone? Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/ Share on other sites More sharing options...
Mchl Posted November 26, 2008 Share Posted November 26, 2008 No PHP can not create automobiles... Or is it not what you're asking about? Hard to say. We only see a picture. We know nothing about functionality of this page. So the answer is: be more specific. Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/#findComment-699768 Share on other sites More sharing options...
Maq Posted November 26, 2008 Share Posted November 26, 2008 No PHP can not create automobiles... It can't! What a weak language... Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/#findComment-699772 Share on other sites More sharing options...
dezkit Posted November 26, 2008 Share Posted November 26, 2008 No PHP can not create automobiles... It can't! What a weak language... Hell yeah it's weak! Let's switch to asp.net because we love Microsoft! Doesn't everybody? They make so much good software, let's just buy their products!! Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/#findComment-699781 Share on other sites More sharing options...
webmaster1 Posted November 26, 2008 Author Share Posted November 26, 2008 No PHP can not create automobiles... I was trying to keep it simple to get a prompt answer but I shall obey captain... Three images would be outputted into a page (via a path stored in mySQL). The image viewer would present the three images as thumbnails (via resizing, I got lazy and avoided GD). The thumbnails when clicked upon would display a larger version of the image above them (without opening a new window). The first thumbnail would be displayed by default as the larger image. It wouldn't require a thumbnail scroll function since there will only ever be three images. Is this something that PHP can faciliate? When I search for PHP image viewers online they mostly describe how to build image galleries which involves leaving the page to view the larger image. Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/#findComment-699784 Share on other sites More sharing options...
blueman378 Posted November 26, 2008 Share Posted November 26, 2008 so now for a productive answer php could create the image gallery like that however it would not have any animation, i.e if you click on a new image the page would reload to show that image. the only way round the arrows would be to once again reload the page but move the array of images along one image. Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/#findComment-699790 Share on other sites More sharing options...
blueman378 Posted November 26, 2008 Share Posted November 26, 2008 opps, it does not have to create a new window it simply has to refresh the page. Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/#findComment-699792 Share on other sites More sharing options...
Maq Posted November 26, 2008 Share Posted November 26, 2008 Why not use JS or flash? Do you have to use PHP or something? Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/#findComment-699793 Share on other sites More sharing options...
webmaster1 Posted November 26, 2008 Author Share Posted November 26, 2008 Why not use JS or flash? Do you have to use PHP or something? I'm concerned that I won't be able to integrate PHP with either of them. I stumble enough when it comes to regular mark up. If you follow this link you'll see a live demo and the complete source code of a JS solution: http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm The only problem is that it doesn't display the larger image by default. The image only shows on the mouse-over. I wouldn't know where to begin in editing the JS source code. So close but not close enough. Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/#findComment-699797 Share on other sites More sharing options...
Maq Posted November 26, 2008 Share Posted November 26, 2008 Just follow the tutorial and replace the image names with however you dynamically take them out of your database with PHP. Make sense? This is almost all JS just a bit of PHP to dynamically change the image names unless you want to hard code them in..... Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/#findComment-699800 Share on other sites More sharing options...
Mchl Posted November 26, 2008 Share Posted November 26, 2008 See lightbox Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/#findComment-699801 Share on other sites More sharing options...
webmaster1 Posted November 26, 2008 Author Share Posted November 26, 2008 Maq: By the sounds of what your saying I can define my image paths as variables and insert them into JS just like html. I'm still stuck with the problem of having a default larger image displayed before any mouseover event but I geuss thats an issue for a JS forum (any reccomendations on a frequently active JS forum?) Mchl: Yep, I've used the lightbox approach before but I want the larger image to swap out within my page (as per the above pictured example) rather than imposed over my page. Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/#findComment-699804 Share on other sites More sharing options...
webmaster1 Posted November 26, 2008 Author Share Posted November 26, 2008 Alrite, I'll get cracking. No point in speculating when I can be doing. I'll get back to ye if I have any beef integrating the PHP with the JS. Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/#findComment-699812 Share on other sites More sharing options...
webmaster1 Posted November 26, 2008 Author Share Posted November 26, 2008 Got the aforementiond JS image viewer script working fine so that it allows a default image prior to mousing over and hence no blank space. Here's the solution if anybody stumbles across this or would like to know how: To load a default image simply paste it in the load div area of the html page: <div id="loadarea" style="width: 600px"> <img src="IMAGEHERE.jpg" alt=""><br> </div> To ensure that there is no blank area on a mouse out simply ensure that following line of the JS file is set to FALSE: hideimgmouseout: false, //Hide enlarged image when mouse moves out of anchor link? Quote Link to comment https://forums.phpfreaks.com/topic/134415-solved-php-image-viewer/#findComment-699861 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.