In the Calendar with Add button, I would like to replace all href="javascript:void(0)"
to href="http://google.com"
when mouseover the image caladd.gif with Javascript and jQuery.
Summary: That means whenever the mouse is over the image, it will trigger the Javascript or jQuery to change the href to another link. The JSFIDDLE below works very well with browsers but it doesn't work with SharePoint 2010.
HTML:
<div id="AsynchronousViewDefault_CalendarView">
<div class="ms-acal-header">
<div>
<table class="ms-acal-month">
</table>
<div class="ms-acal-vlink">
<table>
<tbody>
<tr>
<td><a href="javascript:void(0)" title="Add" evtid="new_item">
<img border="0" src="/_layouts/images/caladd.gif">Add</a></td>
</tr>
</tbody>
</table>
</div>
</div>
Javascript:
$(document).ready(function () {
var abc = $("#AsynchronousViewDefault_CalendarView").find('a[title="Add"][evtid="new_item"]').hover(
function () {
$(this).attr('href', 'http://share/Lists/Calendar.aspx?P=P1');
}
);
});
JSFIDDLE: http://jsfiddle.net/nALMw/