Jump to content

Site Scrolling News Boxes "PLUS"


Heritage1

Recommended Posts

I have been playing around with some simple little scrolling News Boxes, and came up with this for everyone.

You can have a peek at ; PhPvMs Site= http://heritage-va.net/hva

or http://heritage-va.net (Main Site)

Look to the right on theses sites, on the home pages.

Below are some code snippets for above, and I have added some page scrolling scripts that

Work great with PHPVMS also. Hope ya all can use these.

Jimbo "Jungle"

Heritage VA , CEO

<!--Heritage VA 2016 , Demo; http://heritage-va.net/hva-->
<!-- Scrolling News or what ever you'd like to scroll in your site
The below script must be after the head tag, or the body tag.-->
<!-- NOTE: this can also be put into any *.htm page you created in the admin panel
Or even adding a news item, make sure on the news you use the source button first.-->
<script type="text/javascript">
//IMPORTANT::::specify path to your external page:
var iframesrc="external.htm" //you may use any htm,html extensions
//You may change most attributes of iframe tag below, such as width and height:
document.write('<iframe id="datamain" src="'+iframesrc+'" width="150px" height="150px" marginwidth="0" marginheight="0"
hspace="0" vspace="0" frameborder="1" scrolling="no"></iframe>')
</script>
<!-- end of head tag or body tag -->
//===============================================================================================
<!-- Heritage VA 2016: http://heritage-va.net/hva for demos -->
<!-- Page up and down made easy ! -->
<!-- Step #1: Insert into the Head Tag -->
<script>
var Hoffset=70 //Enter buttons' offset from right edge of window (adjust depending on images width)
var Voffset=80 //Enter buttons' offset from bottom edge of window (adjust depending on images height)
var thespeed=3 //Enter scroll speed in integer (Advised: 1-3)
var ieNOTopera=document.all&&navigator.userAgent.indexOf("Opera")==-1
var myspeed=0
var ieHoffset_extra=document.all? 15 : 0
var cross_obj=document.all? document.all.staticbuttons : document.getElementById? document.getElementById("staticbuttons") :
document.staticbuttons
function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function positionit(){
var dsocleft=document.all? iecompattest().scrollLeft : pageXOffset
var dsoctop=document.all? iecompattest().scrollTop : pageYOffset
var window_width=ieNOTopera? iecompattest().clientWidth+ieHoffset_extra : window.innerWidth+ieHoffset_extra
var window_height=ieNOTopera? iecompattest().clientHeight : window.innerHeight
if (document.all||document.getElementById){
cross_obj.style.left=parseInt(dsocleft)+parseInt(window_width)-Hoffset+"px"
cross_obj.style.top=dsoctop+parseInt(window_height)-Voffset+"px"
}
else if (document.layers){
cross_obj.left=dsocleft+window_width-Hoffset
cross_obj.top=dsoctop+window_height-Voffset
}
}
function scrollwindow(){
window.scrollBy(0,myspeed)
}
function initializeIT(){
positionit()
if (myspeed!=0){
scrollwindow()
}
}
if (document.all||document.getElementById||document.layers)
setInterval("initializeIT()",20)
</script>
<!-- End of step #1 -->

<!-- Step #2=Page Scrolling with New arrows,,,, pages etc. -->
<!-- Simply add the below script to the bottom of your page (ie: right above </BODY>):
Or you may put this into your layout.php also. whatever works for your site.-->
<!-- Pay attention and keep these arrows you decide to use inside of the ( div attribute )
You may use arrows of your choice,or create your buttons.remember the ( img src= ) where your
buttons/arrows live etc. Do not change the order of the below lines, it won't work.-->

<div id="staticbuttons" style="position:absolute;z-index:1000">
<a href="javascript:" onmouseover="myspeed=-thespeed" onmouseout="myspeed=0">
<img src="arrows_up.gif" border="0"></a><br>
<a href="javascript:" onmouseover="myspeed=thespeed" onmouseout="myspeed=0">
<img src="arrows_dn.gif" border="0"></a>
</div>
<!-- end of step #2-->

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...