This topic is locked

Show/hide images on the List page

12/4/2023 12:08:44 PM
PHPRunner Tips and Tricks
admin

Just a simple code snippet that will help you hide/show images on the list page by clicking a button. We use Classified template as an example here.

The code below assumes that the field name with the images named 'Picture'. The same code will work in both PHPRunner and ASPRunner.NET.

'Hide images' button. Client Before event code. Two other events should be empty.
$("span[data-fieldname='Picture']").parent().hide();

'Show images' button. Client Before event code. Two other events should be empty.
$("span[data-fieldname='Picture']").parent().show();

With images shown:

img alt

With images hidden:

img alt

S
silvio 12/4/2023

very elegant solution :-)