Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Replacing rel with class

Featured Replies

Hi, this is more to do with lightbox, fancybox, slimbox etc...

 

It seems rel doesn't validate in HTML5. (I'm using slimbox btw)

 

I've replaced rel with class in the HTML and within the JS file. It is working fine, except the prev and next images and the image caption - not displaying at all.

 

Has anyone had any issues with this before?

 

Cheers.

Al.

  • Author

We are having issues with our hosting company (about 2 weeks now) and we haven't been able to connect to our sites through ftp, much, so I am working on it using Wamp.

 

Just uploading it to my personal site now... (different hosting company)

Here is a page using slimbox (still with the rel attribute in place)

Thanks, it would be easier to debug with an online example.

 

You should be looking for if statements in the JS i'd imagine which is checking for a 'rel' attribute, and just replace it with the class.

  • Author

I did a search for 'rel' in the JS and only found one that looked like it needed to be changed, which I did change but it caused the next, prev and image caption to stop working.

Oh, I've just realised, it's because when you're using a class, you're not defining the images as being part of a set (like you would normally doing rel="lightbox[coffee-and-cream]"). I'll see how this can be achieved using a class.

 

Out of interest, why do you want to use a class instead of rel? Is it because you want to use it on something other than a link?

Edited by Lyndsey

  • Author

Oh, I've just realised, it's because when you're using a class, you're not defining the images as being part of a set (like you would normally doing rel="lightbox[coffee-and-cream]"). I'll see how this can be achieved using a class.

 

Out of interest, why do you want to use a class instead of rel? Is it because you want to use it on something other than a link?

 

Purely for validation Lyndsey, it's probably not all that important, but I'd like it to be valid :good:

 

Thanks for that link Wynn, will give it a look over now.

You could considder using Fancybox instead it uses clases to group images. But it doesn't matter that the the rel attribute doesn't validate I'm sure it wil work fine on any browser.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.