Is it posible to have the body tag in an editable region of a template. I want to PreLoad images on some of the pages and not others.

I've tried
<!-- TemplateBeginEditable name="body_tag" -->
<!-- TemplateEndEditable -->

but get an error message.

Alternatively, can I preload images in another area of the body OR head - and how would I do that?

Recommended Answers

All 6 Replies

You cant do that as half of that could would inevitably be in the head(Which couldnt execute it anyway) and half in the body, so thats a structuaral mistake.


I've been preloading images in the onload opton of the body tag.
How can I use a template - for the basic structure of the web page -and also have the ability to preloadimages?

I'm not familiar with template use, how does it work?

Use a stylesheet to select the images.

I'm not familiar with template use, how does it work?

A template is a web page that has editable and non-editable regions. The template isn't actually posted on the web, but it is used to create other pages.

Typically, many pages in a web site will use the same template. This forces a common structure for those pages. Moreover, you can change the template and it automatically changes all the pages that are based on that template.

Templates are normally used when you let a client or some other non-web designer person update/edit their web site with Adobe's Contribute. I think Contribute is a good product that meets a very real need. Few people can create a web site but almost all can update/edit their web site with Contribute.

Use a stylesheet to select the images.

I'm not sure how that would be done with CSS.

My goal was to preLoad the images so they would be ready for a quick image swap on a mouse roll-over. Perhaps this is an old-fashioned concept that is not needed with faster download speeds.

I solved my problem by keeping the onLoad event within the body tag, which is, of course, in a non-editable region. <body onLoad="LoadAllFiles()"> Then, I include the LoadAllFiles() function within the editableRegion of all pages. For those pages where I want to preload the images, I include the following:

<script language="JavaScript" type="text/JavaScript">
function MM_preloadimages() { //v3.0

[snip some standard code]

function LoadAllFiles() {
  MM_preloadimages('../images/Photos/1.jpg','../images/Photos/2.jpg','../images/Photos/3.jpg','../images/Photos/4.jpg',     '../images/Photos/5.jpg','../images/Photos/6.jpg','../images/Photos/7.jpg','../images/Photos/8.jpg','../images/Photos/9.jpg','../images/Photos/10.jpg','../images/Photos/11.jpg','../images/Photos/12.jpg','../images/Photos/13.jpg','../images/Photos/14.jpg')

If the web page has no files that I want to preload I merely insert:

<script language="JavaScript" type="text/JavaScript">
function LoadAllFiles() {}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.