Copy link to clipboard
Copied
I'm making progress and getting a bit more familiar with the program, but now I'm coming up aginst a rather tricky issue which entails modifying some outside elements for use in Dreamweaver. The specific information that I'm looking for at the moment has to do with W3Schools little "how to" tutorial on hover tabs. If you have a better suggesion I'll listen to it.
Background: the old CS6 site which I want to port into the CC2021 version of Dreamweaver has a graphics collection. It's not that well built, I was in the process of learning Dreamweaver when I built it and would like to do it a bit better this time. (No, still not wanting to deal with Bootstrap until I am a good deal more familiar with Dw itself.)
Several pages in the collection have multiple images. I'd rather not make people have to scroll forever to see them all as is the case in the current site. The problem is that the images in the collection are not a uniform size. I've found that templates in Dw do not let you change the dimensions of things in child pages. so I need to use something in the template that will put the images in a container which can be set to 'auto'. I also need a solution which is not going to interfere with the dropdown menu and button rules which are already in the template.
The hover tab appears to be a possibility. I've saved a copy of my present template in a working folder and have copy/pasted the hover tab tutorial into it. It includes a script. I have no clue on how to modify a script in a manner in which will still work.
I have messed with it and the tabs will take graphics (I haven't tried some of the larger ones, or ones of different sizes yet) and it will switch the display by clicking on the buttons. But any attempt to rename anything but the visible button label breaks it, and I can't add any new ones. The example uses city names. I want numbers. And I want more than three of them. A half dozen at least.
Here is the code from the tutorial:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {box-sizing: border-box}
body {font-family: "Lato", sans-serif;}
/* Style the tab */
.tab {
float: left;
border: 1px solid #ccc;
background-color: #f1f1f1;
width: 30%;
height: 300px;
}
/* Style the buttons inside the tab */
.tab button {
display: block;
background-color: inherit;
color: black;
padding: 22px 16px;
width: 100%;
border: none;
outline: none;
text-align: left;
cursor: pointer;
font-size: 17px;
}
/* Change background color of buttons on hover */
.tab button:hover {
background-color: #ddd;
}
/* Create an active/current "tab button" class */
.tab button.active {
background-color: #ccc;
}
/* Style the tab content */
.tabcontent {
float: left;
padding: 0px 12px;
border: 1px solid #ccc;
width: 70%;
border-left: none;
height: 300px;
display: none;
}
/* Clear floats after the tab */
.clearfix::after {
content: "";
clear: both;
display: table;
}
</style>
</head>
<body>
<h2>Hover Tabs</h2>
<p>Move the mouse over a button inside the tabbed menu:</p>
<div class="tab">
<button class="tablinks" onmouseover="openCity(event, 'London')">London</button>
<button class="tablinks" onmouseover="openCity(event, 'Paris')">Paris</button>
<button class="tablinks" onmouseover="openCity(event, 'Tokyo')">Tokyo</button>
</div>
<div id="London" class="tabcontent">
<h3>London</h3>
<p>London is the capital city of England.</p>
</div>
<div id="Paris" class="tabcontent">
<h3>Paris</h3>
<p>Paris is the capital of France.</p>
</div>
<div id="Tokyo" class="tabcontent">
<h3>Tokyo</h3>
<p>Tokyo is the capital of Japan.</p>
</div>
<div class="clearfix"></div>
<script>
function openCity(evt, cityName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}
</script>
</body>
</html>
What do I change to get plain numbered buttons, that I can add more of? As things stand it stops working if I change pretty much of anything.
Try the below code, it's a slight improvement on the code you have provided. I can't help thinking though if you are showing graphics it might be better to show them in an overlay modal window gallery.
The below is activated by 'onclick' rather than 'onmouseover' as that will do nothing in mobile devices. If you're not bothered by mobile footfall then you can always change 'onclick' to 'onmouseover'.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="
...
Well I too am from a graphic design/print background dating back to the 1970's, still participating in it up until recently, so 47 years if you include the 4 years I was at design college - I doubt you can teach me much about graphic/print design, that I don't already know.
It's a shock to the system when you first start getting into web development that much I can tell you, rip up and throw away almost everything you know about graphic design/print when it comes to web design/development, the
......I'm assuming for the nesw .css files it will be the same without the <style></style> tags?
Yes, you are correct
When I opened Dreamweaver again nothing worked. Could have clicked 'til the cows come home and no images would ever show.
No idea what broke. I didn't touch the script. Just formatted the appearnce of the buttons, and copy/pasted some new ones in. If there is a limit to how many buttons one can have it doesn't say.
It happens, usually due to operator error or panic setting in, you st
It's not really accessible at my level of ignorance.
===========
I'm not sure what is confounding you about Fancybox. It's EZPZ to deploy with just 2 scripts.
WORKING EXAMPLE:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fancybox 4 Demo</title>
<!--INSERT FANCYBOX CSS-->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css">
<!--OPTIONAL CLASSIC STYLES FOR FANCYBOX VIEWER-->
<style>
a[data-fancybox] img { cursor: zoom-i
...
You're welcome.
Copy & paste entire code exactly as presented -- WITHOUT any other nonsense.
1. Go to File > Save and name it Fancybox-test.html.
2. Right-click the open document tab in DW > select Open in Browser to see it action.
3. Adjust your browser viewport by dragging the application frame handles to test it's responsiveness.
Fancybox has many options that are detailed at length in the online documentation. Post back if you have any questions.
Copy link to clipboard
Copied
And this morning I open the same file and everything is working perfectly. Problems? What problems?
What you are describing could be a browser caching issue, that catches almost all new developers out. The browser has a habit of keeping old pages in its memory so doesn't always reflect the changes you make in the editor, shutting it down and opening it again could well have cleared the cached page.
A good tip l only recently picked up here is to go to the network tab in your browser tools and check the no cache box. Keep the browser tools open while you are in production and things will run more smoothly.
You might also consider going incognito in the browser, l believe that also won't cache the page.
Copy link to clipboard
Copied
The browser cache affects the behaviour of the pages inside of Dreamweaver? I wasn't checking it in a browser. I haven't got it functioning reliably enough to check it in a browser yet. This is all happening inside of Dreamweaver.
Web development is not my real focus (as if you couldn't tell), I have the one personal website, because I am a disgusting showoff, and have absolutely no interest in trying to build any additional ones. But I am stuck with this one. I do want to keep it online, partially because there is what I believe to be a relatively useful theater crafts book that I have available as a free download in the publicatins collection. But mostly it's just there to show off hobby work and fan art. (And fan theory essays. Lots of essays.)
This is basically the third time I've needed to relearn everything from the ground up in a whole different prograam -- and it may have the same name, but CC2021 is an entirely different progran from CS6, and very few of the of the methods and procedures of CS6 are transferable -- in order to keep the site functioning and to be able to maintain it on my current computer (whichever computer that happens to be). I am miffed at software which breaks if you look sideways at it. But it can hardly be worse than nesting tables inside of other tables ad infinitum as I had to do in GoLive.
Copy link to clipboard
Copied
The browser cache affects the behaviour of the pages inside of Dreamweaver? I wasn't checking it in a browser. I haven't got it functioning reliably enough to check it in a browser yet. This is all happening inside of Dreamweaver.
No, browser caching does not affect anything inside Dreamweaver. I'm not sure what you mean you havent got 'it functioning reliably enough to check it in a browser yet' - that is the ONLY way to check your code functions correctly, so I'm not sure what approach you are taking, unless its just a case of not being adept within the coding environment and you, as the user, are messing things up.
Web development is not my real focus (as if you couldn't tell), I have the one personal website, because I am a disgusting showoff, and have absolutely no interest in trying to build any additional ones. But I am stuck with this one. I do want to keep it online, partially because there is what I believe to be a relatively useful theater crafts book that I have available as a free download in the publicatins collection. But mostly it's just there to show off hobby work and fan art. (And fan theory essays. Lots of essays.)
It doesn't sound as though you have it in you to successfully go on with the workflow you are currently using, web-development is not part time or one-off, its a career journey. You might want to investigate Wix or Weebly, Square Space etc, where supposedly no code knowledge is required.
This is basically the third time I've needed to relearn everything from the ground up in a whole different prograam -- and it may have the same name, but CC2021 is an entirely different progran from CS6, and very few of the of the methods and procedures of CS6 are transferable -- in order to keep the site functioning and to be able to maintain it on my current computer (whichever computer that happens to be). I am miffed at software which breaks if you look sideways at it. But it can hardly be worse than nesting tables inside of other tables ad infinitum as I had to do in GoLive.
As I said, the learning never stops, web-development moves at a fast pace, too fast in my opinion to consider your an expert in anything related to web-development.
Copy link to clipboard
Copied
No, I didn't think that browser caching was likely to be what was going on. I'm working entirely inside Dreamweaver, trying to get something that looks the way I want it to and works consistently. I can manage the first, but the 2nd is still being unattainable.
So far, it hasn't been a bit consistent. It will work, then suddenly stop working. And I can't even take a stab at guessing what I'm going to get in the morning when I've saved something and shut down for the night. Yesterday when I relaunched the program everything broke. Today it works. I did nothing to it in the interim. It seems completely arbitrary.
To say nothing of the fact that two of the colledctions' templates work exactly as they are supposed to, while the one for the third collection requires that I do everything twice over to get a linked page. Really. I generate a new page from the template, port the text into it from the TextEdit file, save it, close it, then go to the template and link it into the menu. Then I save the template and it updates everything *except* that new page. So I have to generate *another* new page from the template, open up the page I just finished, copy/paste everything from that page into the new one, close the orphan page and save the newest one as the same name and replace the previous version. Aftrer that, it updates when I modify the template. Yeah, copy/pasting everything into the new page which already has the link only takes a few minutes, but you cannot tell me that this is the way its supposed to work.
It's a flakey, unstable program, and I'm not a bit happy with it. Hell, CS6 used stylesheets, but it didn't wipe out everything I'd done in three days if it crashed while I was trying to modify a template.
Copy link to clipboard
Copied
I don't use Dreamweaver anymore so I can't comment but I would not use .dwt templates if that is the workflow you are using. I used them early doors and quite frankly I ran into all kinds of issues and had to detach the template on some pages and found some pages based on the template didnt update, nothing but a nightmare, but that's is just my personal experience of .dwt templates, others have different opinions and they seem to work for them.
Copy link to clipboard
Copied
Well, they seemed to work perfectly in CS6. But CC2021 is a different program entirely. I'm juggling more templates than I'd prefer, but when the pages have different navigation arrays in the header, and the header is outside the editable area, using a template is the best way to update things when something gets added to a collection.
The flakey template that won't update the last page created is annoying, but not a difficult work-around. And the issue is easily recognized and *consistent*. I can adapt to consitent. Once that collection is built I probably won't ever need to bother with the template again, since updating an essay page shouldn't require anything but uploading the edited version. After all, the link won't have changed. It's the graphics collection's template which is being completely unpredictable. To the point that I may end up making a seperate template for pages with multiple images and just have to link things in that collection twice over. Which I'd prefer not to do, since that collection is still growing. Slowly, but I expect to be adding pages periodically.