1

I'm creating a calendar for work requests into the team, I want to limit the view to month only which I've done by hiding buttons etc with css and a little Javascript, if you look at the image below you can see my results:

Calendar as it currently looks after my modifications...

There's just one final piece to do, you can still click on the day numbers and go through to the daily breakdown - I don't want this to be possible, it also used to possible by clicking on the back area to where the button currently is (I've outlined in red the area I mean), I stopped this by using:

$('.ms-cal-topday').each(function(){                         
        $(this).removeAttr('href'); 
        $(this).removeAttr('onclick');              

   });

$('.ms-cal-topdayover').each(function(){                         
        $(this).removeAttr('href'); 
        $(this).removeAttr('onclick');              

   });

So what I'm trying to do is the equivalent for the day number (which is outlined in the bluey colour) i.e. stop the user clicking through by removing the href text from the code highlighted in the bottom right of the image in firebug - I've tried various ways using the same format as above but nothing seems to work, does anyone have any ideas? I'd be very grateful.

Also, I do read a lot of posts on here and see the grumbles from people around posting, hope I've covered eveything and it's all formatted correclty etc - I've never really needed to post before as the answers usually been given before so bear in mind it's my 1st post! :)

Let me know and I'll update correct anything...

1

You should also handle the child a tag as follows

$('.ms-cal-topday').each(function(){                         
    $(this).removeAttr('onclick'); 
    $(this).removeAttr('onmouseover');  
    $(this).removeAttr('onmouseout');   
});
$('.ms-cal-topdayover').each(function(){                         
    $(this).removeAttr('onclick'); 
    $(this).removeAttr('onmouseover');  
    $(this).removeAttr('onmouseout');   
});

$('.ms-cal-topday a').each(function(){                         
    $(this).attr('href','#');
});

$('.ms-cal-topdayover a').each(function(){                         
    $(this).attr('href','#');
});
  • BTW - Can't vote up yet or I would! – d3m0n1cd4rkn355 Dec 4 '14 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.