Re-directing to dynamic href in PHP script using JavaScript

Stereofenix

New Member
I have a drop down user menu that contains child links that I cannot get to redirect properly. I unfortunately did not code the front-end, so I'm just trying to get it to link to dynamic PHP urls. I'm also working within the CodeIgniter framework, by the way. There are two clicks in the user's process (similar to Google's user icon). 1. You click the user image and drop down arrow, 2. You see profile, settings, logout. With the following script, clicking the drop-down arrow redirects to the first link, profile, without even doing the drop-down animation. Any thoughts?Here's the PHP file:\[code\]<div class="user css3"> <a href="" class="css3"> <img src="http://stackoverflow.com/questions/10544401/images/user.jpg" alt="user" class="css3" /> </a> <div class="child css3"> <ul class="user_links"> <li><a href="http://stackoverflow.com/questions/10544401/<?=base_url()?>/profile/view/<?=$userID?>/myfeed">Profile</a></li> <li><a href="http://stackoverflow.com/questions/10544401/<?=base_url()?>/settings/">Settings</a></li> <li><a href="http://stackoverflow.com/questions/10544401/<?=base_url()?>/login/logout">Logout</a></li> </ul> </div> </div>\[/code\]Here's the JavaScript for drop-down arrow button:\[code\]$('div.user').click(function() { $('div.user div.child').slideToggle("fast"); $('div.live div.action div.category div.child, div.live div.action div.sort div.child').slideUp(); return false;});\[/code\]Here's the JavaScript that I came up with for the \[code\]<ul>\[/code\] (I'm not much of a JS dev. haha):\[code\]$('ul.user_links li a').click(function() { document.location($(this).attr("href"));});\[/code\]Any thoughts are greatly appreciated!
 
Back
Top