Giter Site home page Giter Site logo

Comments (3)

demtario avatar demtario commented on June 2, 2024 1

Forgive me for closing the issue, but ignoring some images sounds to me like a completely different issue than multiple images in different places in one gallery mentioned in title and your primary description.

Nevertheless, the solution with adding a configurable class/attribute that will be ignored by hes-gallery sounds like a sensible idea. I will try to implement something like this in the near future

from hes-gallery.

demtario avatar demtario commented on June 2, 2024

Hi, <img> tags does not need to be a direct childs of the .hes-gallery class wrapper. You can wrap whole content with this class, and all images should be loaded into one gallery

Example below:

<div class="hes-gallery">
  <h1>Hello world</h1>
  <p>Lorem ipsum</p>
  <img src="test.png" />
  <div class="grid">
    <img src="test2.png" />
    <img src="test2.png" />
    <img src="test2.png" />
  </div>
</div>

Or based on your example:

<!doctype html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<meta name="description" content="">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Kira hes-gallery all in one gallery</title>
		<script src="https://cdn.jsdelivr.net/npm/hes-gallery/dist/hes-gallery.min.js" defer></script>
	</head>
-	<body>
+	<body class="hes-gallery">
-		<div class="hes-gallery">
+		<div>
			<img alt="First image description" src="https://64.media.tumblr.com/b46755ce8132f94072dc11ff1bc521f2/tumblr_o9c27npEFz1st5lhmo1_1280.jpg">
		</div>
		<p>Between the gallery images may be something</p>
-		<div class="hes-gallery">
+		<div>
			<img alt="Second image description" src="https://64.media.tumblr.com/e448b56e7d05e08fc7d50fba6279162a/tumblr_o9c384UrKV1st5lhmo1_1280.jpg">
		</div>
		<p>It may or may not be related to gallery images</p>
-		<div class="hes-gallery">
+		<div>
			<img alt="Third image description" src="https://64.media.tumblr.com/6a3c1841255255d81f00adc0559ae3e1/tumblr_o9c2klYKxX1st5lhmo1_1280.jpg">
		</div>
	</body>
</html>

from hes-gallery.

Kristinita avatar Kristinita commented on June 2, 2024

Status: It doesn’t completely solve the problem

1. Early closing

@demtario, I’m not sure that closing an issue as “completed” 3 days after the own reply without waiting for the reply of the creator of the issue is the best practice.

2. Problem — unexpected images

Even if the user wants to include all the images of an article in a single gallery (as in my example), interface icons and other unwanted images can also end up in the gallery.

Clipboard image in hes-gallery

Also, users may want to include in the single gallery some images (on the different places of the page), but not others, for other reasons.

It would be nice if it would be possible without hard-coding.

3. Possible solutions

  1. For example, class hes-gallery-all. hes-gallery will include all images on the page inside <div class="hes-gallery-all"></div> into a single gallery.
  2. Or perhaps an option ignoredClasses. Values — a list of img classes for which hes-gallery will not be applied. For example, if ignoredClasses: ["KiraInterfaceIcon"], hes-gallery will not add <img class="KiraInterfaceIcon"> to galleries.

Thanks.

from hes-gallery.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.