** 我想在鼠标悬停时更改图像 src,我动态添加了多个图像。**
const Servicesdata = [
{
ID: "01",title: "Power Generation",desc:
" We have rich experience in building thermal,hydro,and combined cycle power plants. We provide customized ready-to-deploy solutions for power plants including total EPC and comprehensive Balance of Plant (BOP) and Flue-gas desulfurization (FGD) solutions.",imgsrc: "https://www.tataprojects.com/images/Transmission-Line.jpg",imgsrcHover: "https://www.tataprojects.com/images/Sunbstations-min.jpg"
},{
ID: "02",title: "Transmission",desc:
"We have successfully commissioned more than 13,000 kms of transmission lines across multiple voltage levels including 800kv HVDC projects",imgsrc: "https://www.tataprojects.com/images/Sunbstations-min.jpg",{
ID: "03",title: "Substations",desc:
"Our optimally designed towers and substation structures allow us to reduce conductor wastage ensuring faster construction and on-time delivery.",imgsrc: "https://www.tataprojects.com/images/Tower-Manufactaring-Unit.jpg",{
ID: "04",title: "Tower Manufacturing Unit",desc:
"We have a state-of-the-art manufacturing unit to manufacture transmission line towers and structures. The unit is spread across 40 acres of land.",imgsrc: "https://www.tataprojects.com/images/Smart-Grid-min.jpg",imgsrcHover: "https://www.tataprojects.com/images/Sunbstations-min.jpg"
}
];
export default Servicesdata;
import react from "react";
import Servicesdata from "../data/Servicesdata";
const Services = () => {
return (
<>
<section classname="services">
<div classname="container mt-5">
<div classname="row">
<div classname="col-md-12">
<h2 classname="text-center heading-style-1">Key Areas</h2>
</div>
</div>
{Servicesdata.map((val,index) => {
return (
<div classname="row featurette align-items-center">
<div classname="col-md-7">
<h2 classname="featurette-heading">{val.title}</h2>
<p classname="lead">{val.desc}</p>
</div>
<div classname="col-md-5">
<img src={val.imgsrc} classname="img-fluid" />
</div>
</div>
);
})}
</div>
</section>
</>
);
};
export default Services;
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>