

This is my Javascript code to initiate the lightGallery: $(".nodoubt"). I've created a jsfiddle that demonstrates the issue (apologies for all the nested DIVs etc., however I'm confident that those are not the cause): I figure that this must be something to do with the 'index' functionality getting stuck after the first click? However, if you then close that image, and then click on a different thumbnail image, you will see the wrong image being enlarged (it's grabbing the first one that you had clicked on). This website is managed by RAK Public Prosecution Department. In other words, if you initially click on a thumbnail image, you'll see the correct larger image being selected in the gallery that pops up. Select the fill style for the cells that meet the criteria.Īs with Excel, you can also apply Conditional Formatting by selecting “Text contains” rather than “Custom formula is” from the Format Rules section of the Conditional format rules box.When I set up my lightGallery dynamically, and use 'index' to target which image should open when a link is clicked, the wrong image shows up unless it's the very first click.From the Format Rules section, select Custom formula is and type in the same formula used in Excel above.The Apply to Range section is already filled in.Highlight the cells you wish to format, then go to Format > Conditional Formatting.Highlighting cells based on their text is similar in Google Sheets. Highlight Cells With Specific Text in Google Sheets Select Cell F5 to indicate the text to find, and then select the formatting you wish to apply.Select the fill style for the cells that meet the criteria. Specify the large image file path in the href attribute. To add the fancyBox image gallery you need to specify the following attributes in the anchor tag of the images. From the Format Rules section, select Custom formula is and type in the same formula used in Excel above. The image’s data is fetched from the MySQL database and the files are retrieved from the server ( images/ directory) using PHP. An array of objects ( src, iframe, subHtml, thumb, poster, responsive, srcset sizes) representing gallery elements. Highlight the cells you wish to format, then go to Format > Conditional Formatting. LightGallery can be instantiated and launched programmatically by setting this option to true and populating dynamicEl option (see below) with the definitions of images. Select the cells you require and then click on Home > Conditional Formatting > Highlight Cells Rules > Text that Contains Highlighting cells based on their text is similar in Google Sheets.
#Lightgallery conditionally open how to#
To simply find cells with specific text, see How to Find & Select Specific Cells.Īnother option is to use one of the default rules that are in Excel to find if the text you require is in the selected cells.You can also highlight all cells with any text in them.To find case sensitive text in your cell, use the FIND Function instead of the SEARCH Function in your formula.This formula returns TRUE when a cell contains the text stored in F9 and formats those cells accordingly. Click Apply to apply the formatting to your selected range, then Close.Click OK, then OK again to return to the Conditional Formatting Rules Manager.Click on the Format button and select your desired formatting.You can do this by using the $ sign around the row and column indicators, or by pressing F4 on the keyboard. Cell F10 needs to be locked as an absolute reference.Select Use a formula to determine which cells to format, and enter the following formula (using the SEARCH and ISNUMBER Functions):.As you type it, you can see the conditional formatting applied instantly.

In the dialog box that appears, write the text you want to highlight, in the left field.

Hover your cursor over ‘Highlight Cells Rules’ and select ‘Text that Contains’.

To highlight cells with certain text defined in another cell, you can use a formula in Conditional Formatting. Highlight Cells With Specific Text Use a Formula This tutorial will demonstrate how to highlight cells if they contain specific text using Conditional Formatting in Excel and Google Sheets.
