Warning: Creating default object from empty value in /home/expressionz/developer.expressionz.in/blogs/wp-content/plugins/download-monitor/classes/download_taxonomies.class.php on line 156

Warning: Creating default object from empty value in /home/expressionz/developer.expressionz.in/blogs/wp-content/plugins/download-monitor/classes/download_taxonomies.class.php on line 156

Warning: Creating default object from empty value in /home/expressionz/developer.expressionz.in/blogs/wp-content/plugins/download-monitor/classes/download_taxonomies.class.php on line 156
Named Anchors | Expressing IT

Posts Tagged ‘ Named Anchors ’

Problem with href attribute in named anchors

Wednesday, October 30th, 2013 By Nik

Sometimes even the simplest things in life that we always took for granted seems to give us a kick on our backside. That is when we get to learn little lessons of life. The simplest piece of code that always worked like charm, fails to work, Today was just that day. I had an issue with a named anchor which I had defined to add a Jquery Smooth Scroll. The scroll to an anchor just failed to work … thankfully it was a very simple fix.

The code that I had (when the named anchor did not work) 
<a href="" id=”a_rate_this”></a> 
Got fixed when , I replaced the above with  
<a href=”javascript:void(0);” id=”a_rate_this”></a>
Or even just remove the href attribute as below
<a id=”a_rate_this”></a>
yeah! but in this case you will loose the default pointer cursor 
of the anchor tag and it will change to cursor of type text. 
You could solve this issue with a css fix, 
i.e. by adding cursor:pointer to the anchor tag.

get ExpressingIT News by Email Subscribe to ExpressingIT by Email or  Follow Me on Twitter


 Subscribe to ExpressingIT RSS
get ExpressingIT News by Email Subscribe to ExpressingIT by Email
 Follow Me on Twitter