Replacing images with text

Help with installation and general calendar setttings

Replacing images with text

Postby vslf » Thu Sep 23, 2010 9:29 am

First of all thanks for providing this excellent script for free!

I would like to change the "cal_prev" and "cal_next" images with text based links but I can't figure out how to call the "calendar_nav" function in "mootools-cal-public.js".

Any help is appreciated. Thanks!
vslf
 
Posts: 2
Joined: Thu Sep 23, 2010 9:25 am

Re: Replacing images with text

Postby chris » Thu Sep 23, 2010 10:13 am

Hi,
Try the following:

1. replace the images in the calendar file with text values like this:
Code: Select all
<div id="cal_prev" title="'.$lang["prev_X_months"].'"><span class="cal_button">back</span></div>
<div id="cal_next" title="'.$lang["next_X_months"].'"><span class="cal_button">next</span></div>

Then, in the JavaScript file change this line (49) at the start of the calendar navegation function:
Code: Select all
$$('#cal_controls img').each(function(img) {

to this:
Code: Select all
$$('#cal_controls .cal_button').each(function(img) {

Finally commento out or remove the following lines slightly lower down (they just replace the image with the mouseover image):
Code: Select all
var extension = src.substring(src.lastIndexOf('.'),src.length)
img.addEvent('mouseenter', function() { img.setProperty('src',src.replace(extension,'_over' + extension)); });
img.addEvent('mouseleave', function() { img.setProperty('src',src); });

That should be all you need to do.
Let me know how it goes or if you have any problems.

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Replacing images with text

Postby vslf » Thu Sep 23, 2010 2:53 pm

Works perfectly.

Thanks a lot, your help is appreciated!
vslf
 
Posts: 2
Joined: Thu Sep 23, 2010 9:25 am


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron