[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

javascript news slide

Posted on 2006-06-14
10
Medium Priority
?
187 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:mubbsher
ID: 16903991
i coundnt find proper script
please give me the exact url of script
0
 

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 29

Accepted Solution

by:
Pravin Asar earned 200 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 29

Expert Comment

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



0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…

650 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