I'm trying to set up a page which will have multiple elements in it. Could be something like books galery where when you click on the thumbnail a modal opens up with the picture of the book, link to publisher (or personal book page) and a description.
I was wondering whether it's more prudent to generate 1 modal per thumbnail (no js needed to manage anything and quick setup) or to setup one modal in which that data would be overwritten depending on which thumbnail you're clicking (less html generated but more complex to set up requiring js and storing information somewhere like data attribute).
I've seen a lot of topics and coverage regarding modals but haven't seen question like that asked so far. Everyone seems to be spamming countless modal "elements" without question.
Could someone shed some light on this for me?
The more efficient and future proof approach would be to incorporate JavaScript. As you would only be storing the data for each book and a single template modal this would conserve bandwidth. Additionally, what if you wanted to add more books? Just adding the data to the "books" array would be much easier in the future rather than having to create a new modal for each new entry.
However, if the gallery size is very small it may not be worth the time and effort to do this.
Hence, this is a design choice, it's up to you to decide what would be the ideal approach for your project.
Related
I'm working on bookstore website. The main page has all the books. Each has it's own button. Every book has it's button linked to the same page (buy.html), I want change content by clicking on different buttons as every book has it's own description
This is my HTML button code
<button onclick="window.open('buy.html')" class="book4">Buy</button>
I need to open buy.html but with different content according to the book
but what happens now is All buttons show the same content
Can any one help me in this issue,
Thanks.
Though your question is rather broad, I think I get your problem.
You need a way to distinguish between books without creating a new page for every book.
There are multiple ways of doing this. Personally I'd recommend using Server-Side scripts for this but you can also do this with JavaScript, you just have to put it in the link.
An example could be this:
<button onclick="window.open('buy.html?book=4')" class="book4">Buy</button>
What this does is open buy.html and specify what book you want to buy so you can create a function to pull only that description out of the database or however you want to do it.
I strongly recommend a database because as soon as you have a hundred or so books your page will get really slow and it's a waste of resources if you only display one.
The best way to get data out of a URL (as far as I know) is like so
Though, next time please post your code too, that would make it a lot easier to pinpoint the problem.
Good luck.
Edit: The JavaScript that I linked was not the best solution and rather complicated so I think a better and more easily understandable function can be found here
This is my first question here, I'm very new to coding so please forgive me any mistakes.
So i started learning html/css/some basic javascript recently and I'm trying to build a website just for practice. So one page on it looks like this:
https://imgur.com/ZHyeprC
And right now i have different html files for each article (linked under the site navigation: Shauna, The First One etc.), so each name of the article takes you to a different page.
What i want to do is to have multiple articles in just one html file, and make them show up/disappear when the name of the article is clicked.
I tried to figure it out somehow in jquery, but i only managed to wrap the article in a div and make it appear when the invisible div is clicked... which isn't much useful.
So is it posibble to do with simple javascript/jquery? If so, the how do i do this?
Thank you all in advance, Michal.
The most easy and practical way is to have one HTML file for each article. It makes your files more organized and easier to find. Otherwise, if your client just want to look at one article the page has to load all articles which may take longer if the client happens to have a slow internet connection.
I am having trouble figuring out how to do even the simplest things in Alfresco, like typing a simple document. I've been Googling and noticed that customizations can be done through HTML documents. I need help and decided to post a question to a knowledgeable user platform. THe following customizations I would like are WAY far fetched and most likely not even achievable, but any help that can be provided I would really appreciate.
*list items in bold are most important
Anyone could be assigned a login and when they logged in they would have access to and easily view all of the contents of the site (or multiple sites that make up one accessible website?)
All of the items on the website would be a hierarchy, the user facing contents of the site would be a list of links with thumbnails, when one link was clicked it would be another list of links with large thumbnails, when one of those links was clicked a text document would be brought up, that document would contain clickable sections, when one of those sections was clicked it would bring up a page only containing the section clicked:
Links (crafts)
2nd layer of links (modules)
Text and image document with clickable links (single module containing clickable sections)
Section (single sections of module)
The module and section text would also contain images and tables throughout and mixed in the text
If a link (module or section) was used in multiple places all instances of the link would be linked to each other. If on instance was edited, the other would also change. THis setting could be turned off for any individual link if necessary.
Every document should have an easy to use live commenting system (something simple like Disqus would work) The comments are the most important on the single section pages but would also be good on the module page
An advanced tagging system that would be part of the entire site/website environment. A user could type anything they wanted as a tag and use multiple tags. The tags would be used for their comments on the content (text, sections) but the tags could be searched (most importantly by the administrators of the site) at any time in the whole environment. A popularity of any tag could also be viewed (I'm not sure how that would work, possibly another section of the site or an easy to see column on any text/image document?)
A user could edit their own comment if they wished but would not be able to delete it entirely. Comments would also be date and time stamped.
I know all of this is most likely impossible but if anyone has an idea of Alfresco customizations that could pull any of this off, or of an entirely different secure platform or site that would perform anything similar to this please let me know.
Thank you!
It sounds like you are looking for a Web Content Management (WCM) System. Alfresco is a Document Management (DM) System. You can use Alfresco as a back-end for a custom content-centric solution, but if you are expecting to install it, start it up, and have anything close to what you've listed above, you are barking up the wrong tree.
Everything you've listed is a front-end concern. You can use whatever you want to develop that functionality, but none of it will leverage Alfresco unless you choose to store some of the data in the Alfresco back-end.
You might be better off looking at something in the WCM space, such as Drupal or Wordpress. Or if you want something Java-based, look at Magnolia CMS or Hippo CMS.
I have a gallery page with four different sections: art, tattoo, info and gallery. The first image of each is displayed in a DIV called imageWrap when the headings are clicked, while the arrow icons (visible on section highlight) cycle through the images and notes via variables which reference a number of arrays.
I want to make the arrow buttons reference the correct variable set dependending on which section is active. Is there a way to listen for the current gallery state and modify the action listeners to handle the correct variable?
The page with the issue is located here:
www.christopherwynne.com/tattoo
I am still fairly new at Java, and any insight would be greatly appreciated.
Well i suggest you learn some Javascript Basics to develop more attractive webpages, i don't think java work on here for doing.
if you don't know anything about Javascript i leave you this resource
Javascript its sexy
JSIS give you the best resource to learn property JS, also give you another tutorials for learn some others frameworks like Meteor
Also if you say "i don't have time to learn JS i need my tattoo web page and the gallery image working" take a look on this page
Codrops Images Galley
Its very easy to adapt to the current web and look pretty nice
Hope it helps
I am trying to allow for the filling out of a form from a lightbox pop up window. One like the one that Get satisfaction uses (though I only need to be able to collect info, not display from a query as well). You can see a Get Satisfaction example at http://tweet.fabeetle.com and clicking the feedback tab.
What is the best way to do this? JQuery?
I used http://www.nickstakenburg.com/projects/lightview/ a while back and it worked very well.
bgadoci, if you're not an experienced javascript user (or you are and want to avoid a lot of unnecessary work) you'll definitely want to go with a Javascript library like jQuery. As far as choosing the right plugin, you should shop around while keeping in mind your objective. Some of them will be friendlier with forms where others are built for images only.
I can recommend colorbox from experience.