39Design Posted March 23, 2011 Share Posted March 23, 2011 Hi everyone! Nice to meet/see/read you. This is my first post and it will probably be a lame one so apologies. I'm a pretty good frontend designer and I've always struggled to learn PHP and my new job is forcing it on me so I'm happy in a "throw me in the deep end" kinda way. I am really stuck! I have a single page that is using jquery to scroll my content left and right via the menu (example attached). What I am trying to do is when on the homepage, don't show the "main logo". When on any other link, show it. I immediately thought of an if/else statement but realised I don't know what or how exactly to target since everything is on the same page and the URL doesn't change. Could I target the image title that is the only image on the homepage? So, something like: <?PHP $image_title = 'home'; if (XXXXX($image_title)) { echo "IMAGE"; } else { echo "NO IMAGE"; } ?> I know that's wrong, I put XXX where I feel like something possibly helpful should go. Heh. :-\ I'm not asking for someone to write code for me, I'm happy to learn but but I would be very grateful if someone could just guide me to what I need to do and off to Google I will go. I haven't been able to find anything that is like: "if image title equals". Hmm... I hope I can do this with PHP. Thanks again, Linda [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
Cagecrawler Posted March 23, 2011 Share Posted March 23, 2011 This is more of a javascript thing than a PHP one. jQuery must have some state stored to remember which page it's showing - you can just use this to test and then if neccessary hide the main logo using javascript. PHP finishes executing before the page is shown to the user. Without getting into AJAX, which is unneccessary in this case, you can't use PHP to change the page without loading a new uri. Quote Link to comment Share on other sites More sharing options...
MrXHellboy Posted March 23, 2011 Share Posted March 23, 2011 I dont exactly get what you want but in the sentence "if image title ==": echo ($image_title == 'home') 'IMAGE' : 'NO IMAGE'; something like this ? Quote Link to comment 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.