Home > Web Front-end > JS Tutorial > How to modify the Wordpress ThickBox click on the picture to display the next picture_javascript skills

How to modify the Wordpress ThickBox click on the picture to display the next picture_javascript skills

WBOY
Release: 2016-05-16 18:14:06
Original
1255 people have browsed it

Taking wordpress 3.0.2 as an example, open wp-includes/js/thickbox/thickbox.js and find the following line of code:

Copy code The code is as follows:

About line 135, below // End Resizing, modify the id='TB_ImageOff' to id='TB_nextImage',
Then if (!(TB_NextHTML === "" not far below the line )){} add:
Copy code The code is as follows:

jQuery("#TB_nextImage ").click(goNext);

Place jQuery("#TB_next").click(goNext); on the next line.
Update:

Suddenly discovered I forgot to change the title of the link. The above code allows you to click on the picture to directly view the next picture. However, the title of the picture link (the yellow block when the mouse is placed on it) has not changed. This is very simple. Change

title ='" thickboxL10n.close "' can be changed to title='" thickboxL10n.next "'. This will read the language pack to display the prompt, or you can write it directly as a string. The effect is as follows:

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template