$("#wrap .project").append($("<a id='previous-project' href='"+ path + "#project/" + data.prev + "'>previous</a><a id='next-project' href='"+ path + "#project/" + data.next + "'>next</a>"));
Messy, I know. The path is the main path of course and data.prev and data.next are links to the next project.
Naturally projects get to an end and then when I hover or click on the link it gives me path/false.
I tried this:
if(data.next == false){$('#wrap .project #prev-project').hide()};
if(data.prev == false){$('#wrap .project #next-project').hide()};
But it doesn’t hide anything. I am alerting the data.next and data.prev and it gives me false. I tried ‘false’ as well in the if, nothing, the links are still showing.
What’s the problem?
How about :
Create a
.nolink {...}style in your stylesheet to style null prev/next text, eg..nolink { color:#e0e0e0; }.You don’t need the ids unless they are used elsewhere.