?
Solved

javascript news slide

Posted on 2006-06-14
10
Medium Priority
?
186 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…
Suggested Courses

771 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