Using LightBox in ASP.NET Core Pages

I am using LightBox v2.0.4 with main pages on a website and I am having problems with the load.gif and closelabel.gif images appearing. I have content pages that are in folders that are 3 layers from the root, their main page is 2 layers from root, the images are in ~ / images /, and the javascript files are in ~ / js /. eg .:

~ / Category / category / subcategory / contentpage.aspx
~ / Categories / master.aspx
~ / Images / loading.gif
~ / Images / closelabel.gif

I tried to change the path of the images in the lightbox.js script to ~ / images / load.gif and ~ / images / closelabel.gif, but that didn't work. I've been digging around the net via google and found no answers ... does anyone here know what the problem is?

Wayne

+2


source to share


3 answers


You cannot use ~ / images ... etc. in .js files. You must use a path relative to your .js file location.



0


source


Check the paths for these two files in your lightbox.js file:

//
//  Configuration
//
var fileLoadingImage = "images/loading.gif";        
var fileBottomNavCloseImage = "images/closelabel.gif";

      



And make sure the master page links to the js files correctly - the last time I got it right on the master page VS was showing red squiglies, but it worked :-)

0


source


try linking these images in full path from the root of the domain, starting with / (for example, '/images/loading.gif') without ~, but with a leading slash.

0


source







All Articles