Solved

javascript news slide

Posted on 2006-06-14
10
179 Views
Last Modified: 2008-01-16
hi all
i m showing the news like that
  <marquee scrollamount=1 scrolldelay=50 direction=up width=165 height=180  id="marq"  >
NEWS
NEWS
NEW
</marquee>
but i want to enhance in news panel
like
if i move my mouse in the upper area of news panel than news will scroll down and when i move the mouse pointer on the bottom then news will scroll up side
can any body tell me how i gonna make this possible
and if some body know any script like that or sample please reply me thanks
0
Comment
Question by:mubbsher
10 Comments
 
LVL 15

Expert Comment

by:deepaknet
ID: 16903226
Did you check out http://www.dynamicdrive.com/?
0
 

Author Comment

by:mubbsher
ID: 16903237
yes i check but i couldnt found any proper script
0
 
LVL 7

Expert Comment

by:geordie007
ID: 16903238

you should NOT use the marquee tag. the marquee tag is not part of the HTML specification, and will not pass any validation test.

you can find a whole host of scroller examples and techniques here:

http://www.dynamicdrive.com/dynamicindex2/index.html
0
 

Author Comment

by:mubbsher
ID: 16903991
i coundnt find proper script
please give me the exact url of script
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:mubbsher
ID: 16904334
i have check all the links on that page
http://www.dynamicdrive.com/dynamicindex2/index.html
but i still cant find the script which is suitable for my requirement
please help
0
 
LVL 28

Accepted Solution

by:
Pravin Asar earned 50 total points
ID: 16906786
Here is one what you are looking for.

<html>
<head><title>Marquee Direction Control</title>
<!-- Copyright PravinAsar http://www.asarconsultants.com -->
</head>
<body>
<script language="javascript">
var isFirefox = 0;
if (navigator.userAgent.match('Firefox')) {
isFirefox = 1;
}
function getX(evt) {
      if (document.all) { return (evt.clientX); }
      else if (isFirefox) { return (evt.clientX); }
      return (evt.layerX);
}
function getY(evt) {
      if (document.all) { return (evt.clientY); }
      else if (isFirefox) { return (evt.clientY); }
      return (evt.layerY);
}
function getTarget(evt) {
      if (document.all) { return (evt.srcElement); }
      return (evt.target);
}
function GetTagPosition (tagObj) {
      this.x = tagObj.offsetLeft;
      this.y = tagObj.offsetTop;
}
function GetTagDimension (tagObj) {
      this.width = tagObj.offsetWidth;
      this.height = tagObj.offsetHeight;
}
function ChangeDir (evt) {
  if (!evt) { evt = window.event; }
  var trgObj = null;
  var x =0; y =0;
  x = getX(evt);
  y = getY(evt);
  trgObj = getTarget(evt);
  if (trgObj) {
    var pos = new GetTagPosition(trgObj);
    var dim = new GetTagDimension(trgObj);
      x -= pos.x;
      y -= pos.y;
    if ( y < dim.height/2) {
        var dir = 'down';
    }
    else {
        var dir = 'up';
    }
    window.status = 'Dire ' + dir;
      trgObj.direction = dir;
  }
}
</script>
<marquee id="ScrollTxt" scrollamount="2"
direction="up" loop="true" width="250" height="200" scrolldelay="10" onmousemove="ChangeDir(event)"  style="border: red solid 5;">
<br>This is a marquee with
<br>direction control based on
<br>mouse position over it.
<br>If mouse is in the upper half
<br>it scrolls down
<br>If mouse is in the lower half
<br>it scrolls up
</marquee>
</body>
</html>
0
 

Author Comment

by:mubbsher
ID: 16909008
yah it working on the independent page
thanks for help
but i want to include the news.php page in other files when i m going to include only slide is working but on mouse up and mouse down scrolling is not moving up and down
wht should i do
thanks for putting me on the track pravinasar
0
 
LVL 28

Expert Comment

by:Pravin Asar
ID: 16910556
To include news.php in other page, you may use iframe



0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now